diff options
author | 2020-07-09 13:24:35 -0700 | |
---|---|---|
committer | 2020-07-22 22:46:37 +0100 | |
commit | f650f173b0d327241ded7fbb4d0cb4b5f8b94b36 (patch) | |
tree | 728de08e4df66706de9980e8ee3272ef7ba8e5c3 | |
parent | 1a6d9b141160c5d59d689545a7b034d30118b9cc (diff) | |
download | poky-f650f173b0d327241ded7fbb4d0cb4b5f8b94b36.tar.gz poky-f650f173b0d327241ded7fbb4d0cb4b5f8b94b36.tar.bz2 poky-f650f173b0d327241ded7fbb4d0cb4b5f8b94b36.zip |
go-dep: Fix build on riscv64
Bring in only patch from meta-riscv here
(From OE-Core rev: ecd7563cc29d5b473a3c71f35c4d9c98ff4d2349)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 2e6e7b0be6e5ba5ab8fe9478c1dfdd530d22123f)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/go/go-dep/0001-Update-sys-module-to-latest.patch | 145574 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-dep_0.5.4.bb | 1 |
2 files changed, 145575 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-dep/0001-Update-sys-module-to-latest.patch b/meta/recipes-devtools/go/go-dep/0001-Update-sys-module-to-latest.patch new file mode 100644 index 0000000000..b13bb9e665 --- /dev/null +++ b/meta/recipes-devtools/go/go-dep/0001-Update-sys-module-to-latest.patch @@ -0,0 +1,145574 @@ +From f7904cb91a1b18e893ffbd25b450926d145d0e0a Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 22 Apr 2020 18:44:48 -0700 +Subject: [PATCH] Update sys module to latest + +Gets us riscv support + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Gopkg.lock | 4 +- + .../golang.org/x/sys/unix/affinity_linux.go | 86 + + vendor/golang.org/x/sys/unix/aliases.go | 14 + + vendor/golang.org/x/sys/unix/asm_aix_ppc64.s | 17 + + .../x/sys/unix/asm_dragonfly_amd64.s | 10 +- + ...sm_linux_mips64x.s => asm_freebsd_arm64.s} | 11 +- + vendor/golang.org/x/sys/unix/asm_linux_386.s | 36 +- + .../golang.org/x/sys/unix/asm_linux_amd64.s | 30 +- + vendor/golang.org/x/sys/unix/asm_linux_arm.s | 35 +- + .../golang.org/x/sys/unix/asm_linux_arm64.s | 30 +- + .../golang.org/x/sys/unix/asm_linux_mips64x.s | 36 +- + .../golang.org/x/sys/unix/asm_linux_mipsx.s | 33 +- + .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 38 +- + .../golang.org/x/sys/unix/asm_linux_riscv64.s | 47 + + .../golang.org/x/sys/unix/asm_linux_s390x.s | 28 + + ...asm_linux_mips64x.s => asm_netbsd_arm64.s} | 17 +- + ...sm_linux_mips64x.s => asm_openbsd_arm64.s} | 9 +- + .../golang.org/x/sys/unix/bluetooth_linux.go | 1 + + vendor/golang.org/x/sys/unix/cap_freebsd.go | 30 +- + vendor/golang.org/x/sys/unix/constants.go | 2 +- + vendor/golang.org/x/sys/unix/dev_aix_ppc.go | 27 + + vendor/golang.org/x/sys/unix/dev_aix_ppc64.go | 29 + + vendor/golang.org/x/sys/unix/dev_darwin.go | 24 + + vendor/golang.org/x/sys/unix/dev_dragonfly.go | 30 + + vendor/golang.org/x/sys/unix/dev_freebsd.go | 30 + + vendor/golang.org/x/sys/unix/dev_linux.go | 8 +- + vendor/golang.org/x/sys/unix/dev_netbsd.go | 29 + + vendor/golang.org/x/sys/unix/dev_openbsd.go | 29 + + vendor/golang.org/x/sys/unix/dirent.go | 2 +- + vendor/golang.org/x/sys/unix/endian_little.go | 2 +- + vendor/golang.org/x/sys/unix/env_unix.go | 8 +- + vendor/golang.org/x/sys/unix/env_unset.go | 14 - + .../x/sys/unix/errors_freebsd_386.go | 6 + + .../x/sys/unix/errors_freebsd_amd64.go | 6 + + .../x/sys/unix/errors_freebsd_arm64.go | 17 + + .../x/sys/unix/{flock.go => fcntl.go} | 18 +- + vendor/golang.org/x/sys/unix/fcntl_darwin.go | 18 + + ...ck_linux_32bit.go => fcntl_linux_32bit.go} | 0 + vendor/golang.org/x/sys/unix/fdset.go | 29 + + vendor/golang.org/x/sys/unix/file_unix.go | 27 - + vendor/golang.org/x/sys/unix/gccgo.go | 20 +- + vendor/golang.org/x/sys/unix/gccgo_c.c | 12 +- + .../x/sys/unix/gccgo_linux_amd64.go | 2 +- + .../x/sys/unix/gccgo_linux_sparc64.go | 20 - + vendor/golang.org/x/sys/unix/ioctl.go | 65 + + vendor/golang.org/x/sys/unix/mkasm_darwin.go | 78 + + vendor/golang.org/x/sys/unix/mkmerge.go | 521 +++ + vendor/golang.org/x/sys/unix/mkpost.go | 63 +- + vendor/golang.org/x/sys/unix/mksyscall.go | 402 +++ + .../x/sys/unix/mksyscall_aix_ppc.go | 415 +++ + .../x/sys/unix/mksyscall_aix_ppc64.go | 614 ++++ + .../x/sys/unix/mksyscall_solaris.go | 341 ++ + .../golang.org/x/sys/unix/mksysctl_openbsd.go | 355 +++ + vendor/golang.org/x/sys/unix/mksysnum.go | 190 ++ + .../golang.org/x/sys/unix/openbsd_pledge.go | 38 - + vendor/golang.org/x/sys/unix/pagesize_unix.go | 15 + + .../golang.org/x/sys/unix/pledge_openbsd.go | 163 + + vendor/golang.org/x/sys/unix/race.go | 2 +- + vendor/golang.org/x/sys/unix/race0.go | 4 +- + .../x/sys/unix/readdirent_getdents.go | 12 + + .../x/sys/unix/readdirent_getdirentries.go | 19 + + .../x/sys/unix/sockcmsg_dragonfly.go | 16 + + .../golang.org/x/sys/unix/sockcmsg_linux.go | 4 +- + vendor/golang.org/x/sys/unix/sockcmsg_unix.go | 28 +- + .../x/sys/unix/sockcmsg_unix_other.go | 38 + + vendor/golang.org/x/sys/unix/str.go | 2 +- + vendor/golang.org/x/sys/unix/syscall.go | 38 +- + vendor/golang.org/x/sys/unix/syscall_aix.go | 536 ++++ + .../golang.org/x/sys/unix/syscall_aix_ppc.go | 54 + + .../x/sys/unix/syscall_aix_ppc64.go | 85 + + vendor/golang.org/x/sys/unix/syscall_bsd.go | 112 +- + .../x/sys/unix/syscall_darwin.1_12.go | 29 + + .../x/sys/unix/syscall_darwin.1_13.go | 101 + + .../golang.org/x/sys/unix/syscall_darwin.go | 263 +- + .../x/sys/unix/syscall_darwin_386.1_11.go | 9 + + .../x/sys/unix/syscall_darwin_386.go | 45 +- + .../x/sys/unix/syscall_darwin_amd64.1_11.go | 9 + + .../x/sys/unix/syscall_darwin_amd64.go | 45 +- + .../x/sys/unix/syscall_darwin_arm.1_11.go | 11 + + .../x/sys/unix/syscall_darwin_arm.go | 51 +- + .../x/sys/unix/syscall_darwin_arm64.1_11.go | 11 + + .../x/sys/unix/syscall_darwin_arm64.go | 47 +- + .../x/sys/unix/syscall_darwin_libSystem.go | 33 + + .../x/sys/unix/syscall_dragonfly.go | 136 +- + .../x/sys/unix/syscall_dragonfly_amd64.go | 21 +- + .../golang.org/x/sys/unix/syscall_freebsd.go | 592 ++-- + .../x/sys/unix/syscall_freebsd_386.go | 31 +- + .../x/sys/unix/syscall_freebsd_amd64.go | 31 +- + .../x/sys/unix/syscall_freebsd_arm.go | 27 +- + ...nfly_amd64.go => syscall_freebsd_arm64.go} | 31 +- + .../golang.org/x/sys/unix/syscall_illumos.go | 57 + + vendor/golang.org/x/sys/unix/syscall_linux.go | 1030 +++++- + .../x/sys/unix/syscall_linux_386.go | 47 +- + .../x/sys/unix/syscall_linux_amd64.go | 80 +- + .../x/sys/unix/syscall_linux_arm.go | 64 +- + .../x/sys/unix/syscall_linux_arm64.go | 111 +- + .../golang.org/x/sys/unix/syscall_linux_gc.go | 14 + + .../x/sys/unix/syscall_linux_gc_386.go | 16 + + .../x/sys/unix/syscall_linux_gccgo_386.go | 30 + + .../x/sys/unix/syscall_linux_gccgo_arm.go | 20 + + .../x/sys/unix/syscall_linux_mips64x.go | 53 +- + .../x/sys/unix/syscall_linux_mipsx.go | 47 +- + .../x/sys/unix/syscall_linux_ppc64x.go | 59 +- + ...inux_arm64.go => syscall_linux_riscv64.go} | 118 +- + .../x/sys/unix/syscall_linux_s390x.go | 44 +- + .../x/sys/unix/syscall_linux_sparc64.go | 48 +- + .../golang.org/x/sys/unix/syscall_netbsd.go | 156 +- + .../x/sys/unix/syscall_netbsd_386.go | 21 +- + .../x/sys/unix/syscall_netbsd_amd64.go | 21 +- + .../x/sys/unix/syscall_netbsd_arm.go | 21 +- + ...etbsd_amd64.go => syscall_netbsd_arm64.go} | 25 +- + .../golang.org/x/sys/unix/syscall_no_getwd.go | 11 - + .../golang.org/x/sys/unix/syscall_openbsd.go | 199 +- + .../x/sys/unix/syscall_openbsd_386.go | 25 +- + .../x/sys/unix/syscall_openbsd_amd64.go | 25 +- + .../x/sys/unix/syscall_openbsd_arm.go | 27 +- + .../x/sys/unix/syscall_openbsd_arm64.go | 41 + + .../golang.org/x/sys/unix/syscall_solaris.go | 128 +- + .../x/sys/unix/syscall_solaris_amd64.go | 24 +- + vendor/golang.org/x/sys/unix/syscall_unix.go | 176 +- + .../golang.org/x/sys/unix/syscall_unix_gc.go | 2 +- + ...l_unix_gc.go => syscall_unix_gc_ppc64x.go} | 21 +- + vendor/golang.org/x/sys/unix/timestruct.go | 82 + + .../unix/{types_netbsd.go => types_aix.go} | 196 +- + vendor/golang.org/x/sys/unix/types_darwin.go | 41 +- + .../golang.org/x/sys/unix/types_dragonfly.go | 66 +- + vendor/golang.org/x/sys/unix/types_freebsd.go | 178 +- + vendor/golang.org/x/sys/unix/types_netbsd.go | 73 +- + vendor/golang.org/x/sys/unix/types_openbsd.go | 78 +- + vendor/golang.org/x/sys/unix/types_solaris.go | 54 +- + .../golang.org/x/sys/unix/unveil_openbsd.go | 42 + + vendor/golang.org/x/sys/unix/xattr_bsd.go | 240 ++ + .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1384 ++++++++ + .../x/sys/unix/zerrors_aix_ppc64.go | 1385 ++++++++ + .../x/sys/unix/zerrors_darwin_386.go | 391 ++- + .../x/sys/unix/zerrors_darwin_amd64.go | 391 ++- + .../x/sys/unix/zerrors_darwin_arm.go | 391 ++- + .../x/sys/unix/zerrors_darwin_arm64.go | 391 ++- + .../x/sys/unix/zerrors_dragonfly_amd64.go | 355 ++- + .../x/sys/unix/zerrors_freebsd_386.go | 508 ++- + .../x/sys/unix/zerrors_freebsd_amd64.go | 506 ++- + .../x/sys/unix/zerrors_freebsd_arm.go | 368 ++- + ...ebsd_amd64.go => zerrors_freebsd_arm64.go} | 509 ++- + vendor/golang.org/x/sys/unix/zerrors_linux.go | 2469 +++++++++++++++ + .../x/sys/unix/zerrors_linux_386.go | 2690 ++++------------ + .../x/sys/unix/zerrors_linux_amd64.go | 2691 ++++------------ + .../x/sys/unix/zerrors_linux_arm.go | 2701 ++++------------ + .../x/sys/unix/zerrors_linux_arm64.go | 2673 ++++------------ + .../x/sys/unix/zerrors_linux_mips.go | 2702 ++++------------ + .../x/sys/unix/zerrors_linux_mips64.go | 2702 ++++------------ + .../x/sys/unix/zerrors_linux_mips64le.go | 2702 ++++------------ + .../x/sys/unix/zerrors_linux_mipsle.go | 2702 ++++------------ + .../x/sys/unix/zerrors_linux_ppc64.go | 2816 ++++------------- + .../x/sys/unix/zerrors_linux_ppc64le.go | 2816 ++++------------- + .../x/sys/unix/zerrors_linux_riscv64.go | 771 +++++ + .../x/sys/unix/zerrors_linux_s390x.go | 2812 ++++------------ + .../x/sys/unix/zerrors_linux_sparc64.go | 2013 +++--------- + .../x/sys/unix/zerrors_netbsd_386.go | 325 +- + .../x/sys/unix/zerrors_netbsd_amd64.go | 325 +- + .../x/sys/unix/zerrors_netbsd_arm.go | 325 +- + ...etbsd_amd64.go => zerrors_netbsd_arm64.go} | 327 +- + .../x/sys/unix/zerrors_openbsd_386.go | 339 +- + .../x/sys/unix/zerrors_openbsd_amd64.go | 576 ++-- + .../x/sys/unix/zerrors_openbsd_arm.go | 333 +- + ...nbsd_amd64.go => zerrors_openbsd_arm64.go} | 605 ++-- + .../x/sys/unix/zerrors_solaris_amd64.go | 380 ++- + .../x/sys/unix/zptrace_armnn_linux.go | 41 + + .../x/sys/unix/zptrace_linux_arm64.go | 17 + + .../x/sys/unix/zptrace_mipsnn_linux.go | 50 + + .../x/sys/unix/zptrace_mipsnnle_linux.go | 50 + + .../x/sys/unix/zptrace_x86_linux.go | 80 + + .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1484 +++++++++ + ..._netbsd_amd64.go => zsyscall_aix_ppc64.go} | 936 +++--- + .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 1192 +++++++ + .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 1070 +++++++ + ...win_arm.go => zsyscall_darwin_386.1_11.go} | 416 ++- + .../x/sys/unix/zsyscall_darwin_386.1_13.go | 41 + + .../x/sys/unix/zsyscall_darwin_386.1_13.s | 12 + + .../x/sys/unix/zsyscall_darwin_386.go | 1314 ++++++-- + .../x/sys/unix/zsyscall_darwin_386.s | 284 ++ + ...arm64.go => zsyscall_darwin_amd64.1_11.go} | 416 ++- + .../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 41 + + .../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 12 + + .../x/sys/unix/zsyscall_darwin_amd64.go | 1314 ++++++-- + .../x/sys/unix/zsyscall_darwin_amd64.s | 284 ++ + ...win_arm.go => zsyscall_darwin_arm.1_11.go} | 389 ++- + .../x/sys/unix/zsyscall_darwin_arm.1_13.go | 41 + + .../x/sys/unix/zsyscall_darwin_arm.1_13.s | 12 + + .../x/sys/unix/zsyscall_darwin_arm.go | 1301 ++++++-- + .../x/sys/unix/zsyscall_darwin_arm.s | 282 ++ + ...arm64.go => zsyscall_darwin_arm64.1_11.go} | 389 ++- + .../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 41 + + .../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 12 + + .../x/sys/unix/zsyscall_darwin_arm64.go | 1301 ++++++-- + .../x/sys/unix/zsyscall_darwin_arm64.s | 282 ++ + .../x/sys/unix/zsyscall_dragonfly_amd64.go | 238 +- + .../x/sys/unix/zsyscall_freebsd_386.go | 204 +- + .../x/sys/unix/zsyscall_freebsd_amd64.go | 204 +- + .../x/sys/unix/zsyscall_freebsd_arm.go | 204 +- + ...bsd_amd64.go => zsyscall_freebsd_arm64.go} | 206 +- + .../x/sys/unix/zsyscall_illumos_amd64.go | 87 + + ...scall_linux_s390x.go => zsyscall_linux.go} | 774 ++--- + .../x/sys/unix/zsyscall_linux_386.go | 1573 +-------- + .../x/sys/unix/zsyscall_linux_amd64.go | 1607 +--------- + .../x/sys/unix/zsyscall_linux_arm.go | 1626 +--------- + .../x/sys/unix/zsyscall_linux_arm64.go | 1513 +-------- + .../x/sys/unix/zsyscall_linux_mips.go | 1567 +-------- + .../x/sys/unix/zsyscall_linux_mips64.go | 1552 +-------- + .../x/sys/unix/zsyscall_linux_mips64le.go | 1552 +-------- + .../x/sys/unix/zsyscall_linux_mipsle.go | 1567 +-------- + .../x/sys/unix/zsyscall_linux_ppc64.go | 1586 +--------- + .../x/sys/unix/zsyscall_linux_ppc64le.go | 1586 +--------- + .../x/sys/unix/zsyscall_linux_riscv64.go | 582 ++++ + .../x/sys/unix/zsyscall_linux_s390x.go | 1570 +-------- + .../x/sys/unix/zsyscall_linux_sparc64.go | 1247 +------- + .../x/sys/unix/zsyscall_netbsd_386.go | 551 +++- + .../x/sys/unix/zsyscall_netbsd_amd64.go | 551 +++- + .../x/sys/unix/zsyscall_netbsd_arm.go | 551 +++- + ...ebsd_amd64.go => zsyscall_netbsd_arm64.go} | 262 +- + .../x/sys/unix/zsyscall_openbsd_386.go | 338 +- + .../x/sys/unix/zsyscall_openbsd_amd64.go | 338 +- + .../x/sys/unix/zsyscall_openbsd_arm.go | 338 +- + ...arwin_386.go => zsyscall_openbsd_arm64.go} | 289 +- + .../x/sys/unix/zsyscall_solaris_amd64.go | 382 ++- + ...sctl_openbsd.go => zsysctl_openbsd_386.go} | 4 +- + ...tl_openbsd.go => zsysctl_openbsd_amd64.go} | 42 +- + ...sctl_openbsd.go => zsysctl_openbsd_arm.go} | 6 +- + ...tl_openbsd.go => zsysctl_openbsd_arm64.go} | 47 +- + .../x/sys/unix/zsysnum_darwin_386.go | 60 +- + .../x/sys/unix/zsysnum_darwin_amd64.go | 62 +- + .../x/sys/unix/zsysnum_darwin_arm.go | 14 +- + .../x/sys/unix/zsysnum_darwin_arm64.go | 14 +- + .../x/sys/unix/zsysnum_dragonfly_amd64.go | 176 +- + .../x/sys/unix/zsysnum_freebsd_386.go | 731 +++-- + .../x/sys/unix/zsysnum_freebsd_amd64.go | 731 +++-- + .../x/sys/unix/zsysnum_freebsd_arm.go | 731 +++-- + .../x/sys/unix/zsysnum_freebsd_arm64.go | 396 +++ + .../x/sys/unix/zsysnum_linux_386.go | 808 ++--- + .../x/sys/unix/zsysnum_linux_amd64.go | 19 +- + .../x/sys/unix/zsysnum_linux_arm.go | 745 ++--- + .../x/sys/unix/zsysnum_linux_arm64.go | 20 +- + .../x/sys/unix/zsysnum_linux_mips.go | 779 ++--- + .../x/sys/unix/zsysnum_linux_mips64.go | 19 +- + .../x/sys/unix/zsysnum_linux_mips64le.go | 19 +- + .../x/sys/unix/zsysnum_linux_mipsle.go | 779 ++--- + .../x/sys/unix/zsysnum_linux_ppc64.go | 33 +- + .../x/sys/unix/zsysnum_linux_ppc64le.go | 33 +- + ...inux_arm64.go => zsysnum_linux_riscv64.go} | 23 +- + .../x/sys/unix/zsysnum_linux_s390x.go | 80 +- + .../x/sys/unix/zsysnum_linux_sparc64.go | 35 +- + .../x/sys/unix/zsysnum_netbsd_386.go | 4 +- + .../x/sys/unix/zsysnum_netbsd_amd64.go | 4 +- + .../x/sys/unix/zsysnum_netbsd_arm.go | 4 +- + ..._netbsd_386.go => zsysnum_netbsd_arm64.go} | 6 +- + .../x/sys/unix/zsysnum_openbsd_386.go | 223 +- + .../x/sys/unix/zsysnum_openbsd_amd64.go | 223 +- + .../x/sys/unix/zsysnum_openbsd_arm.go | 217 +- + ...penbsd_arm.go => zsysnum_openbsd_arm64.go} | 218 +- + .../x/sys/unix/zsysnum_solaris_amd64.go | 13 - + .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 352 +++ + .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 356 +++ + .../x/sys/unix/ztypes_darwin_386.go | 195 +- + .../x/sys/unix/ztypes_darwin_amd64.go | 241 +- + .../x/sys/unix/ztypes_darwin_arm.go | 195 +- + .../x/sys/unix/ztypes_darwin_arm64.go | 246 +- + .../x/sys/unix/ztypes_dragonfly_amd64.go | 213 +- + .../x/sys/unix/ztypes_freebsd_386.go | 426 ++- + .../x/sys/unix/ztypes_freebsd_amd64.go | 448 ++- + .../x/sys/unix/ztypes_freebsd_arm.go | 427 ++- + ...eebsd_amd64.go => ztypes_freebsd_arm64.go} | 430 ++- + vendor/golang.org/x/sys/unix/ztypes_linux.go | 2340 ++++++++++++++ + .../golang.org/x/sys/unix/ztypes_linux_386.go | 878 ++--- + .../x/sys/unix/ztypes_linux_amd64.go | 881 ++---- + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 899 +++--- + .../x/sys/unix/ztypes_linux_arm64.go | 883 ++---- + .../x/sys/unix/ztypes_linux_mips.go | 864 ++--- + .../x/sys/unix/ztypes_linux_mips64.go | 880 ++---- + .../x/sys/unix/ztypes_linux_mips64le.go | 880 ++---- + .../x/sys/unix/ztypes_linux_mipsle.go | 864 ++--- + .../x/sys/unix/ztypes_linux_ppc64.go | 889 ++---- + .../x/sys/unix/ztypes_linux_ppc64le.go | 889 ++---- + .../x/sys/unix/ztypes_linux_riscv64.go | 621 ++++ + .../x/sys/unix/ztypes_linux_s390x.go | 842 ++--- + .../x/sys/unix/ztypes_linux_sparc64.go | 910 +++--- + .../x/sys/unix/ztypes_netbsd_386.go | 145 +- + .../x/sys/unix/ztypes_netbsd_amd64.go | 152 +- + .../x/sys/unix/ztypes_netbsd_arm.go | 151 +- + ...netbsd_amd64.go => ztypes_netbsd_arm64.go} | 154 +- + .../x/sys/unix/ztypes_openbsd_386.go | 173 +- + .../x/sys/unix/ztypes_openbsd_amd64.go | 264 +- + .../x/sys/unix/ztypes_openbsd_arm.go | 255 +- + ...enbsd_amd64.go => ztypes_openbsd_arm64.go} | 260 +- + .../x/sys/unix/ztypes_solaris_amd64.go | 239 +- + 293 files changed, 60017 insertions(+), 59731 deletions(-) + create mode 100644 vendor/golang.org/x/sys/unix/affinity_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/aliases.go + create mode 100644 vendor/golang.org/x/sys/unix/asm_aix_ppc64.s + copy vendor/golang.org/x/sys/unix/{asm_linux_mips64x.s => asm_freebsd_arm64.s} (71%) + create mode 100644 vendor/golang.org/x/sys/unix/asm_linux_riscv64.s + copy vendor/golang.org/x/sys/unix/{asm_linux_mips64x.s => asm_netbsd_arm64.s} (60%) + copy vendor/golang.org/x/sys/unix/{asm_linux_mips64x.s => asm_openbsd_arm64.s} (76%) + create mode 100644 vendor/golang.org/x/sys/unix/dev_aix_ppc.go + create mode 100644 vendor/golang.org/x/sys/unix/dev_aix_ppc64.go + create mode 100644 vendor/golang.org/x/sys/unix/dev_darwin.go + create mode 100644 vendor/golang.org/x/sys/unix/dev_dragonfly.go + create mode 100644 vendor/golang.org/x/sys/unix/dev_freebsd.go + create mode 100644 vendor/golang.org/x/sys/unix/dev_netbsd.go + create mode 100644 vendor/golang.org/x/sys/unix/dev_openbsd.go + delete mode 100644 vendor/golang.org/x/sys/unix/env_unset.go + create mode 100644 vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go + rename vendor/golang.org/x/sys/unix/{flock.go => fcntl.go} (54%) + create mode 100644 vendor/golang.org/x/sys/unix/fcntl_darwin.go + rename vendor/golang.org/x/sys/unix/{flock_linux_32bit.go => fcntl_linux_32bit.go} (100%) + create mode 100644 vendor/golang.org/x/sys/unix/fdset.go + delete mode 100644 vendor/golang.org/x/sys/unix/file_unix.go + delete mode 100644 vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go + create mode 100644 vendor/golang.org/x/sys/unix/ioctl.go + create mode 100644 vendor/golang.org/x/sys/unix/mkasm_darwin.go + create mode 100644 vendor/golang.org/x/sys/unix/mkmerge.go + create mode 100644 vendor/golang.org/x/sys/unix/mksyscall.go + create mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go + create mode 100644 vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go + create mode 100644 vendor/golang.org/x/sys/unix/mksyscall_solaris.go + create mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.go + create mode 100644 vendor/golang.org/x/sys/unix/mksysnum.go + delete mode 100644 vendor/golang.org/x/sys/unix/openbsd_pledge.go + create mode 100644 vendor/golang.org/x/sys/unix/pagesize_unix.go + create mode 100644 vendor/golang.org/x/sys/unix/pledge_openbsd.go + create mode 100644 vendor/golang.org/x/sys/unix/readdirent_getdents.go + create mode 100644 vendor/golang.org/x/sys/unix/readdirent_getdirentries.go + create mode 100644 vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go + create mode 100644 vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_aix.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_aix_ppc.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go + copy vendor/golang.org/x/sys/unix/{syscall_dragonfly_amd64.go => syscall_freebsd_arm64.go} (59%) + create mode 100644 vendor/golang.org/x/sys/unix/syscall_illumos.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gc.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go + copy vendor/golang.org/x/sys/unix/{syscall_linux_arm64.go => syscall_linux_riscv64.go} (68%) + copy vendor/golang.org/x/sys/unix/{syscall_netbsd_amd64.go => syscall_netbsd_arm64.go} (50%) + delete mode 100644 vendor/golang.org/x/sys/unix/syscall_no_getwd.go + create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go + copy vendor/golang.org/x/sys/unix/{syscall_unix_gc.go => syscall_unix_gc_ppc64x.go} (51%) + create mode 100644 vendor/golang.org/x/sys/unix/timestruct.go + copy vendor/golang.org/x/sys/unix/{types_netbsd.go => types_aix.go} (53%) + create mode 100644 vendor/golang.org/x/sys/unix/unveil_openbsd.go + create mode 100644 vendor/golang.org/x/sys/unix/xattr_bsd.go + create mode 100644 vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go + create mode 100644 vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go + copy vendor/golang.org/x/sys/unix/{zerrors_freebsd_amd64.go => zerrors_freebsd_arm64.go} (80%) + create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go + copy vendor/golang.org/x/sys/unix/{zerrors_netbsd_amd64.go => zerrors_netbsd_arm64.go} (89%) + copy vendor/golang.org/x/sys/unix/{zerrors_openbsd_amd64.go => zerrors_openbsd_arm64.go} (76%) + create mode 100644 vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go + create mode 100644 vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/zptrace_x86_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go + copy vendor/golang.org/x/sys/unix/{zsyscall_netbsd_amd64.go => zsyscall_aix_ppc64.go} (57%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go + copy vendor/golang.org/x/sys/unix/{zsyscall_darwin_arm.go => zsyscall_darwin_386.1_11.go} (85%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s + copy vendor/golang.org/x/sys/unix/{zsyscall_darwin_arm64.go => zsyscall_darwin_amd64.1_11.go} (85%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s + copy vendor/golang.org/x/sys/unix/{zsyscall_darwin_arm.go => zsyscall_darwin_arm.1_11.go} (85%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.go + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s + copy vendor/golang.org/x/sys/unix/{zsyscall_darwin_arm64.go => zsyscall_darwin_arm64.1_11.go} (84%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s + copy vendor/golang.org/x/sys/unix/{zsyscall_freebsd_amd64.go => zsyscall_freebsd_arm64.go} (90%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go + copy vendor/golang.org/x/sys/unix/{zsyscall_linux_s390x.go => zsyscall_linux.go} (79%) + create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go + copy vendor/golang.org/x/sys/unix/{zsyscall_freebsd_amd64.go => zsyscall_netbsd_arm64.go} (92%) + copy vendor/golang.org/x/sys/unix/{zsyscall_darwin_386.go => zsyscall_openbsd_arm64.go} (87%) + copy vendor/golang.org/x/sys/unix/{zsysctl_openbsd.go => zsysctl_openbsd_386.go} (99%) + copy vendor/golang.org/x/sys/unix/{zsysctl_openbsd.go => zsysctl_openbsd_amd64.go} (91%) + copy vendor/golang.org/x/sys/unix/{zsysctl_openbsd.go => zsysctl_openbsd_arm.go} (99%) + rename vendor/golang.org/x/sys/unix/{zsysctl_openbsd.go => zsysctl_openbsd_arm64.go} (91%) + create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go + copy vendor/golang.org/x/sys/unix/{zsysnum_linux_arm64.go => zsysnum_linux_riscv64.go} (92%) + copy vendor/golang.org/x/sys/unix/{zsysnum_netbsd_386.go => zsysnum_netbsd_arm64.go} (99%) + copy vendor/golang.org/x/sys/unix/{zsysnum_openbsd_arm.go => zsysnum_openbsd_arm64.go} (67%) + delete mode 100644 vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go + create mode 100644 vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go + create mode 100644 vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go + copy vendor/golang.org/x/sys/unix/{ztypes_freebsd_amd64.go => ztypes_freebsd_arm64.go} (54%) + create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux.go + create mode 100644 vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go + copy vendor/golang.org/x/sys/unix/{ztypes_netbsd_amd64.go => ztypes_netbsd_arm64.go} (73%) + copy vendor/golang.org/x/sys/unix/{ztypes_openbsd_amd64.go => ztypes_openbsd_arm64.go} (58%) + +diff --git a/Gopkg.lock b/Gopkg.lock +index b4333103..01a867d5 100644 +--- a/Gopkg.lock ++++ b/Gopkg.lock +@@ -112,11 +112,11 @@ + + [[projects]] + branch = "master" +- digest = "1:51912e607c5e28a89fdc7e41d3377b92086ab7f76ded236765dbf98d0a704c5d" ++ digest = "1:f8181d8aa1e268255316ec12ab5402d4f671b1da6d7ad40abdf2f92c0404b67d" + name = "golang.org/x/sys" + packages = ["unix"] + pruneopts = "NUT" +- revision = "bb24a47a89eac6c1227fbcb2ae37a8b9ed323366" ++ revision = "1957bb5e6d1f523308b49060df02171d06ddfc77" + + [[projects]] + branch = "v2" +diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go +new file mode 100644 +index 00000000..6e5c81ac +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/affinity_linux.go +@@ -0,0 +1,86 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// CPU affinity functions ++ ++package unix ++ ++import ( ++ "math/bits" ++ "unsafe" ++) ++ ++const cpuSetSize = _CPU_SETSIZE / _NCPUBITS ++ ++// CPUSet represents a CPU affinity mask. ++type CPUSet [cpuSetSize]cpuMask ++ ++func schedAffinity(trap uintptr, pid int, set *CPUSet) error { ++ _, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set))) ++ if e != 0 { ++ return errnoErr(e) ++ } ++ return nil ++} ++ ++// SchedGetaffinity gets the CPU affinity mask of the thread specified by pid. ++// If pid is 0 the calling thread is used. ++func SchedGetaffinity(pid int, set *CPUSet) error { ++ return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set) ++} ++ ++// SchedSetaffinity sets the CPU affinity mask of the thread specified by pid. ++// If pid is 0 the calling thread is used. ++func SchedSetaffinity(pid int, set *CPUSet) error { ++ return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set) ++} ++ ++// Zero clears the set s, so that it contains no CPUs. ++func (s *CPUSet) Zero() { ++ for i := range s { ++ s[i] = 0 ++ } ++} ++ ++func cpuBitsIndex(cpu int) int { ++ return cpu / _NCPUBITS ++} ++ ++func cpuBitsMask(cpu int) cpuMask { ++ return cpuMask(1 << (uint(cpu) % _NCPUBITS)) ++} ++ ++// Set adds cpu to the set s. ++func (s *CPUSet) Set(cpu int) { ++ i := cpuBitsIndex(cpu) ++ if i < len(s) { ++ s[i] |= cpuBitsMask(cpu) ++ } ++} ++ ++// Clear removes cpu from the set s. ++func (s *CPUSet) Clear(cpu int) { ++ i := cpuBitsIndex(cpu) ++ if i < len(s) { ++ s[i] &^= cpuBitsMask(cpu) ++ } ++} ++ ++// IsSet reports whether cpu is in the set s. ++func (s *CPUSet) IsSet(cpu int) bool { ++ i := cpuBitsIndex(cpu) ++ if i < len(s) { ++ return s[i]&cpuBitsMask(cpu) != 0 ++ } ++ return false ++} ++ ++// Count returns the number of CPUs in the set s. ++func (s *CPUSet) Count() int { ++ c := 0 ++ for _, b := range s { ++ c += bits.OnesCount64(uint64(b)) ++ } ++ return c ++} +diff --git a/vendor/golang.org/x/sys/unix/aliases.go b/vendor/golang.org/x/sys/unix/aliases.go +new file mode 100644 +index 00000000..951fce4d +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/aliases.go +@@ -0,0 +1,14 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris ++// +build go1.9 ++ ++package unix ++ ++import "syscall" ++ ++type Signal = syscall.Signal ++type Errno = syscall.Errno ++type SysProcAttr = syscall.SysProcAttr +diff --git a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s +new file mode 100644 +index 00000000..06f84b85 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s +@@ -0,0 +1,17 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build !gccgo ++ ++#include "textflag.h" ++ ++// ++// System calls for ppc64, AIX are implemented in runtime/syscall_aix.go ++// ++ ++TEXT ·syscall6(SB),NOSPLIT,$0-88 ++ JMP syscall·syscall6(SB) ++ ++TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 ++ JMP syscall·rawSyscall6(SB) +diff --git a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s b/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s +index d5ed6726..603dd572 100644 +--- a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s ++++ b/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s +@@ -13,17 +13,17 @@ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-64 ++TEXT ·Syscall(SB),NOSPLIT,$0-56 + JMP syscall·Syscall(SB) + +-TEXT ·Syscall6(SB),NOSPLIT,$0-88 ++TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + +-TEXT ·Syscall9(SB),NOSPLIT,$0-112 ++TEXT ·Syscall9(SB),NOSPLIT,$0-104 + JMP syscall·Syscall9(SB) + +-TEXT ·RawSyscall(SB),NOSPLIT,$0-64 ++TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + JMP syscall·RawSyscall(SB) + +-TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 ++TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + JMP syscall·RawSyscall6(SB) +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s +similarity index 71% +copy from vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +copy to vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s +index 724e580c..d9318cbf 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s ++++ b/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s +@@ -1,15 +1,13 @@ +-// Copyright 2015 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. + +-// +build linux +-// +build mips64 mips64le + // +build !gccgo + + #include "textflag.h" + + // +-// System calls for mips64, Linux ++// System call support for ARM64, FreeBSD + // + + // Just jump to package syscall's implementation for all these functions. +@@ -21,7 +19,10 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56 + TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + +-TEXT ·RawSyscall(SB),NOSPLIT,$0-56 ++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 +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_386.s b/vendor/golang.org/x/sys/unix/asm_linux_386.s +index 4db29093..448bebbb 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_386.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_386.s +@@ -10,21 +10,51 @@ + // System calls for 386, Linux + // + ++// See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 ++// instead of the glibc-specific "CALL 0x10(GS)". ++#define INVOKE_SYSCALL INT $0x80 ++ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-28 ++TEXT ·Syscall(SB),NOSPLIT,$0-28 + JMP syscall·Syscall(SB) + +-TEXT ·Syscall6(SB),NOSPLIT,$0-40 ++TEXT ·Syscall6(SB),NOSPLIT,$0-40 + JMP syscall·Syscall6(SB) + ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 ++ CALL runtime·entersyscall(SB) ++ MOVL trap+0(FP), AX // syscall entry ++ MOVL a1+4(FP), BX ++ MOVL a2+8(FP), CX ++ MOVL a3+12(FP), DX ++ MOVL $0, SI ++ MOVL $0, DI ++ INVOKE_SYSCALL ++ MOVL AX, r1+16(FP) ++ MOVL DX, r2+20(FP) ++ CALL runtime·exitsyscall(SB) ++ RET ++ + TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + JMP syscall·RawSyscall(SB) + +-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 ++TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + JMP syscall·RawSyscall6(SB) + ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 ++ MOVL trap+0(FP), AX // syscall entry ++ MOVL a1+4(FP), BX ++ MOVL a2+8(FP), CX ++ MOVL a3+12(FP), DX ++ MOVL $0, SI ++ MOVL $0, DI ++ INVOKE_SYSCALL ++ MOVL AX, r1+16(FP) ++ MOVL DX, r2+20(FP) ++ RET ++ + TEXT ·socketcall(SB),NOSPLIT,$0-36 + JMP syscall·socketcall(SB) + +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s +index 44e25c62..c6468a95 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s +@@ -13,17 +13,45 @@ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-56 ++TEXT ·Syscall(SB),NOSPLIT,$0-56 + JMP syscall·Syscall(SB) + + TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 ++ CALL runtime·entersyscall(SB) ++ MOVQ a1+8(FP), DI ++ MOVQ a2+16(FP), SI ++ MOVQ a3+24(FP), DX ++ MOVQ $0, R10 ++ MOVQ $0, R8 ++ MOVQ $0, R9 ++ MOVQ trap+0(FP), AX // syscall entry ++ SYSCALL ++ MOVQ AX, r1+32(FP) ++ MOVQ DX, r2+40(FP) ++ CALL runtime·exitsyscall(SB) ++ RET ++ + TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + JMP syscall·RawSyscall(SB) + + TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + JMP syscall·RawSyscall6(SB) + ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 ++ MOVQ a1+8(FP), DI ++ MOVQ a2+16(FP), SI ++ MOVQ a3+24(FP), DX ++ MOVQ $0, R10 ++ MOVQ $0, R8 ++ MOVQ $0, R9 ++ MOVQ trap+0(FP), AX // syscall entry ++ SYSCALL ++ MOVQ AX, r1+32(FP) ++ MOVQ DX, r2+40(FP) ++ RET ++ + TEXT ·gettimeofday(SB),NOSPLIT,$0-16 + JMP syscall·gettimeofday(SB) +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm.s b/vendor/golang.org/x/sys/unix/asm_linux_arm.s +index cf0b5746..cf0f3575 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_arm.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_arm.s +@@ -13,17 +13,44 @@ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-28 ++TEXT ·Syscall(SB),NOSPLIT,$0-28 + B syscall·Syscall(SB) + +-TEXT ·Syscall6(SB),NOSPLIT,$0-40 ++TEXT ·Syscall6(SB),NOSPLIT,$0-40 + B syscall·Syscall6(SB) + ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 ++ BL runtime·entersyscall(SB) ++ MOVW trap+0(FP), R7 ++ MOVW a1+4(FP), R0 ++ MOVW a2+8(FP), R1 ++ MOVW a3+12(FP), R2 ++ MOVW $0, R3 ++ MOVW $0, R4 ++ MOVW $0, R5 ++ SWI $0 ++ MOVW R0, r1+16(FP) ++ MOVW $0, R0 ++ MOVW R0, r2+20(FP) ++ BL runtime·exitsyscall(SB) ++ RET ++ + TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + B syscall·RawSyscall(SB) + +-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 ++TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + B syscall·RawSyscall6(SB) + +-TEXT ·seek(SB),NOSPLIT,$0-32 ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 ++ MOVW trap+0(FP), R7 // syscall entry ++ MOVW a1+4(FP), R0 ++ MOVW a2+8(FP), R1 ++ MOVW a3+12(FP), R2 ++ SWI $0 ++ MOVW R0, r1+16(FP) ++ MOVW $0, R0 ++ MOVW R0, r2+20(FP) ++ RET ++ ++TEXT ·seek(SB),NOSPLIT,$0-28 + B syscall·seek(SB) +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s +index 4be9bfed..afe6fdf6 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s +@@ -11,14 +11,42 @@ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-56 ++TEXT ·Syscall(SB),NOSPLIT,$0-56 + B syscall·Syscall(SB) + + TEXT ·Syscall6(SB),NOSPLIT,$0-80 + B syscall·Syscall6(SB) + ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 ++ BL runtime·entersyscall(SB) ++ MOVD a1+8(FP), R0 ++ MOVD a2+16(FP), R1 ++ MOVD a3+24(FP), R2 ++ MOVD $0, R3 ++ MOVD $0, R4 ++ MOVD $0, R5 ++ MOVD trap+0(FP), R8 // syscall entry ++ SVC ++ MOVD R0, r1+32(FP) // r1 ++ MOVD R1, r2+40(FP) // r2 ++ BL runtime·exitsyscall(SB) ++ RET ++ + TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + B syscall·RawSyscall(SB) + + TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + B syscall·RawSyscall6(SB) ++ ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 ++ MOVD a1+8(FP), R0 ++ MOVD a2+16(FP), R1 ++ MOVD a3+24(FP), R2 ++ MOVD $0, R3 ++ MOVD $0, R4 ++ MOVD $0, R5 ++ MOVD trap+0(FP), R8 // syscall entry ++ SVC ++ MOVD R0, r1+32(FP) ++ MOVD R1, r2+40(FP) ++ RET +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +index 724e580c..ab9d6383 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +@@ -15,14 +15,42 @@ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-56 ++TEXT ·Syscall(SB),NOSPLIT,$0-56 + JMP syscall·Syscall(SB) + +-TEXT ·Syscall6(SB),NOSPLIT,$0-80 ++TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + +-TEXT ·RawSyscall(SB),NOSPLIT,$0-56 ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 ++ JAL runtime·entersyscall(SB) ++ MOVV a1+8(FP), R4 ++ MOVV a2+16(FP), R5 ++ MOVV a3+24(FP), R6 ++ MOVV R0, R7 ++ MOVV R0, R8 ++ MOVV R0, R9 ++ MOVV trap+0(FP), R2 // syscall entry ++ SYSCALL ++ MOVV R2, r1+32(FP) ++ MOVV R3, r2+40(FP) ++ JAL runtime·exitsyscall(SB) ++ RET ++ ++TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + JMP syscall·RawSyscall(SB) + +-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 ++TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + JMP syscall·RawSyscall6(SB) ++ ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 ++ MOVV a1+8(FP), R4 ++ MOVV a2+16(FP), R5 ++ MOVV a3+24(FP), R6 ++ MOVV R0, R7 ++ MOVV R0, R8 ++ MOVV R0, R9 ++ MOVV trap+0(FP), R2 // syscall entry ++ SYSCALL ++ MOVV R2, r1+32(FP) ++ MOVV R3, r2+40(FP) ++ RET +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s +index 2ea42575..99e53990 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s +@@ -15,17 +15,40 @@ + // Just jump to package syscall's implementation for all these functions. + // The runtime may know about them. + +-TEXT ·Syscall(SB),NOSPLIT,$0-28 ++TEXT ·Syscall(SB),NOSPLIT,$0-28 + JMP syscall·Syscall(SB) + +-TEXT ·Syscall6(SB),NOSPLIT,$0-40 ++TEXT ·Syscall6(SB),NOSPLIT,$0-40 + JMP syscall·Syscall6(SB) + +-TEXT ·Syscall9(SB),NOSPLIT,$0-52 ++TEXT ·Syscall9(SB),NOSPLIT,$0-52 + JMP syscall·Syscall9(SB) + +-TEXT ·RawSyscall(SB),NOSPLIT,$0-28 ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 ++ JAL runtime·entersyscall(SB) ++ MOVW a1+4(FP), R4 ++ MOVW a2+8(FP), R5 ++ MOVW a3+12(FP), R6 ++ MOVW R0, R7 ++ MOVW trap+0(FP), R2 // syscall entry ++ SYSCALL ++ MOVW R2, r1+16(FP) // r1 ++ MOVW R3, r2+20(FP) // r2 ++ JAL runtime·exitsyscall(SB) ++ RET ++ ++TEXT ·RawSyscall(SB),NOSPLIT,$0-28 + JMP syscall·RawSyscall(SB) + +-TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 ++TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 + JMP syscall·RawSyscall6(SB) ++ ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 ++ MOVW a1+4(FP), R4 ++ MOVW a2+8(FP), R5 ++ MOVW a3+12(FP), R6 ++ MOVW trap+0(FP), R2 // syscall entry ++ SYSCALL ++ MOVW R2, r1+16(FP) ++ MOVW R3, r2+20(FP) ++ RET +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +index 8d231feb..88f71255 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +@@ -15,14 +15,30 @@ + // 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 ·RawSyscall(SB),NOSPLIT,$0-56 +- BR syscall·RawSyscall(SB) +- +-TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 +- BR syscall·RawSyscall6(SB) ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 ++ BL runtime·entersyscall(SB) ++ MOVD a1+8(FP), R3 ++ MOVD a2+16(FP), R4 ++ MOVD a3+24(FP), R5 ++ MOVD R0, R6 ++ MOVD R0, R7 ++ MOVD R0, R8 ++ MOVD trap+0(FP), R9 // syscall entry ++ SYSCALL R9 ++ MOVD R3, r1+32(FP) ++ MOVD R4, r2+40(FP) ++ BL runtime·exitsyscall(SB) ++ RET ++ ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 ++ MOVD a1+8(FP), R3 ++ MOVD a2+16(FP), R4 ++ MOVD a3+24(FP), R5 ++ MOVD R0, R6 ++ MOVD R0, R7 ++ MOVD R0, R8 ++ MOVD trap+0(FP), R9 // syscall entry ++ SYSCALL R9 ++ MOVD R3, r1+32(FP) ++ MOVD R4, r2+40(FP) ++ RET +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +new file mode 100644 +index 00000000..3cfefed2 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +@@ -0,0 +1,47 @@ ++// 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. ++ ++// +build riscv64,!gccgo ++ ++#include "textflag.h" ++ ++// ++// System calls for linux/riscv64. ++// ++// Where available, just jump to package syscall's implementation of ++// these functions. ++ ++TEXT ·Syscall(SB),NOSPLIT,$0-56 ++ JMP syscall·Syscall(SB) ++ ++TEXT ·Syscall6(SB),NOSPLIT,$0-80 ++ JMP syscall·Syscall6(SB) ++ ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 ++ CALL runtime·entersyscall(SB) ++ MOV a1+8(FP), A0 ++ MOV a2+16(FP), A1 ++ MOV a3+24(FP), A2 ++ MOV trap+0(FP), A7 // syscall entry ++ ECALL ++ MOV A0, r1+32(FP) // r1 ++ MOV A1, r2+40(FP) // r2 ++ CALL runtime·exitsyscall(SB) ++ RET ++ ++TEXT ·RawSyscall(SB),NOSPLIT,$0-56 ++ JMP syscall·RawSyscall(SB) ++ ++TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 ++ JMP syscall·RawSyscall6(SB) ++ ++TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 ++ MOV a1+8(FP), A0 ++ MOV a2+16(FP), A1 ++ MOV a3+24(FP), A2 ++ MOV trap+0(FP), A7 // syscall entry ++ ECALL ++ MOV A0, r1+32(FP) ++ MOV A1, r2+40(FP) ++ RET +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s +index 11889859..a5a863c6 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s ++++ b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s +@@ -21,8 +21,36 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56 + TEXT ·Syscall6(SB),NOSPLIT,$0-80 + BR syscall·Syscall6(SB) + ++TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 ++ BL runtime·entersyscall(SB) ++ MOVD a1+8(FP), R2 ++ MOVD a2+16(FP), R3 ++ MOVD a3+24(FP), R4 ++ MOVD $0, R5 ++ MOVD $0, R6 ++ MOVD $0, R7 ++ MOVD trap+0(FP), R1 // syscall entry ++ SYSCALL ++ MOVD R2, r1+32(FP) ++ MOVD R3, r2+40(FP) ++ 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), R2 ++ MOVD a2+16(FP), R3 ++ MOVD a3+24(FP), R4 ++ MOVD $0, R5 ++ MOVD $0, R6 ++ MOVD $0, R7 ++ MOVD trap+0(FP), R1 // syscall entry ++ SYSCALL ++ MOVD R2, r1+32(FP) ++ MOVD R3, r2+40(FP) ++ RET +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s +similarity index 60% +copy from vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +copy to vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s +index 724e580c..6f98ba5a 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s ++++ b/vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s +@@ -1,28 +1,29 @@ +-// Copyright 2015 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. + +-// +build linux +-// +build mips64 mips64le + // +build !gccgo + + #include "textflag.h" + + // +-// System calls for mips64, Linux ++// System call support for ARM64, NetBSD + // + + // 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) ++ B syscall·Syscall(SB) + + TEXT ·Syscall6(SB),NOSPLIT,$0-80 +- JMP syscall·Syscall6(SB) ++ B syscall·Syscall6(SB) ++ ++TEXT ·Syscall9(SB),NOSPLIT,$0-104 ++ B syscall·Syscall9(SB) + + TEXT ·RawSyscall(SB),NOSPLIT,$0-56 +- JMP syscall·RawSyscall(SB) ++ B syscall·RawSyscall(SB) + + TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 +- JMP syscall·RawSyscall6(SB) ++ B syscall·RawSyscall6(SB) +diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s +similarity index 76% +copy from vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +copy to vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s +index 724e580c..0cedea3d 100644 +--- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s ++++ b/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s +@@ -1,15 +1,13 @@ +-// Copyright 2015 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. + +-// +build linux +-// +build mips64 mips64le + // +build !gccgo + + #include "textflag.h" + + // +-// System calls for mips64, Linux ++// System call support for arm64, OpenBSD + // + + // Just jump to package syscall's implementation for all these functions. +@@ -21,6 +19,9 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56 + 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) + +diff --git a/vendor/golang.org/x/sys/unix/bluetooth_linux.go b/vendor/golang.org/x/sys/unix/bluetooth_linux.go +index 6e322969..a178a614 100644 +--- a/vendor/golang.org/x/sys/unix/bluetooth_linux.go ++++ b/vendor/golang.org/x/sys/unix/bluetooth_linux.go +@@ -23,6 +23,7 @@ const ( + HCI_CHANNEL_USER = 1 + HCI_CHANNEL_MONITOR = 2 + HCI_CHANNEL_CONTROL = 3 ++ HCI_CHANNEL_LOGGING = 4 + ) + + // Socketoption Level +diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/vendor/golang.org/x/sys/unix/cap_freebsd.go +index 83b6bcea..df520487 100644 +--- a/vendor/golang.org/x/sys/unix/cap_freebsd.go ++++ b/vendor/golang.org/x/sys/unix/cap_freebsd.go +@@ -7,7 +7,7 @@ + package unix + + import ( +- errorspkg "errors" ++ "errors" + "fmt" + ) + +@@ -60,26 +60,26 @@ func CapRightsSet(rights *CapRights, setrights []uint64) error { + + n := caparsize(rights) + if n < capArSizeMin || n > capArSizeMax { +- return errorspkg.New("bad rights size") ++ return errors.New("bad rights size") + } + + for _, right := range setrights { + if caprver(right) != CAP_RIGHTS_VERSION_00 { +- return errorspkg.New("bad right version") ++ return errors.New("bad right version") + } + i, err := rightToIndex(right) + if err != nil { + return err + } + if i >= n { +- return errorspkg.New("index overflow") ++ return errors.New("index overflow") + } + if capidxbit(rights.Rights[i]) != capidxbit(right) { +- return errorspkg.New("index mismatch") ++ return errors.New("index mismatch") + } + rights.Rights[i] |= right + if capidxbit(rights.Rights[i]) != capidxbit(right) { +- return errorspkg.New("index mismatch (after assign)") ++ return errors.New("index mismatch (after assign)") + } + } + +@@ -95,26 +95,26 @@ func CapRightsClear(rights *CapRights, clearrights []uint64) error { + + n := caparsize(rights) + if n < capArSizeMin || n > capArSizeMax { +- return errorspkg.New("bad rights size") ++ return errors.New("bad rights size") + } + + for _, right := range clearrights { + if caprver(right) != CAP_RIGHTS_VERSION_00 { +- return errorspkg.New("bad right version") ++ return errors.New("bad right version") + } + i, err := rightToIndex(right) + if err != nil { + return err + } + if i >= n { +- return errorspkg.New("index overflow") ++ return errors.New("index overflow") + } + if capidxbit(rights.Rights[i]) != capidxbit(right) { +- return errorspkg.New("index mismatch") ++ return errors.New("index mismatch") + } + rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF) + if capidxbit(rights.Rights[i]) != capidxbit(right) { +- return errorspkg.New("index mismatch (after assign)") ++ return errors.New("index mismatch (after assign)") + } + } + +@@ -130,22 +130,22 @@ func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) { + + n := caparsize(rights) + if n < capArSizeMin || n > capArSizeMax { +- return false, errorspkg.New("bad rights size") ++ return false, errors.New("bad rights size") + } + + for _, right := range setrights { + if caprver(right) != CAP_RIGHTS_VERSION_00 { +- return false, errorspkg.New("bad right version") ++ return false, errors.New("bad right version") + } + i, err := rightToIndex(right) + if err != nil { + return false, err + } + if i >= n { +- return false, errorspkg.New("index overflow") ++ return false, errors.New("index overflow") + } + if capidxbit(rights.Rights[i]) != capidxbit(right) { +- return false, errorspkg.New("index mismatch") ++ return false, errors.New("index mismatch") + } + if (rights.Rights[i] & right) != right { + return false, nil +diff --git a/vendor/golang.org/x/sys/unix/constants.go b/vendor/golang.org/x/sys/unix/constants.go +index a96f0ebc..3a6ac648 100644 +--- a/vendor/golang.org/x/sys/unix/constants.go ++++ b/vendor/golang.org/x/sys/unix/constants.go +@@ -2,7 +2,7 @@ + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + +-// +build darwin dragonfly freebsd linux netbsd openbsd solaris ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + + package unix + +diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go +new file mode 100644 +index 00000000..5e5fb451 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go +@@ -0,0 +1,27 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build aix ++// +build ppc ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used by AIX. ++ ++package unix ++ ++// Major returns the major component of a Linux device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev >> 16) & 0xffff) ++} ++ ++// Minor returns the minor component of a Linux device number. ++func Minor(dev uint64) uint32 { ++ return uint32(dev & 0xffff) ++} ++ ++// Mkdev returns a Linux device number generated from the given major and minor ++// components. ++func Mkdev(major, minor uint32) uint64 { ++ return uint64(((major) << 16) | (minor)) ++} +diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go +new file mode 100644 +index 00000000..8b401244 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go +@@ -0,0 +1,29 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build aix ++// +build ppc64 ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used AIX. ++ ++package unix ++ ++// Major returns the major component of a Linux device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev & 0x3fffffff00000000) >> 32) ++} ++ ++// Minor returns the minor component of a Linux device number. ++func Minor(dev uint64) uint32 { ++ return uint32((dev & 0x00000000ffffffff) >> 0) ++} ++ ++// Mkdev returns a Linux device number generated from the given major and minor ++// components. ++func Mkdev(major, minor uint32) uint64 { ++ var DEVNO64 uint64 ++ DEVNO64 = 0x8000000000000000 ++ return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) ++} +diff --git a/vendor/golang.org/x/sys/unix/dev_darwin.go b/vendor/golang.org/x/sys/unix/dev_darwin.go +new file mode 100644 +index 00000000..8d1dc0fa +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_darwin.go +@@ -0,0 +1,24 @@ ++// 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. ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used in Darwin's sys/types.h header. ++ ++package unix ++ ++// Major returns the major component of a Darwin device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev >> 24) & 0xff) ++} ++ ++// Minor returns the minor component of a Darwin device number. ++func Minor(dev uint64) uint32 { ++ return uint32(dev & 0xffffff) ++} ++ ++// Mkdev returns a Darwin device number generated from the given major and minor ++// components. ++func Mkdev(major, minor uint32) uint64 { ++ return (uint64(major) << 24) | uint64(minor) ++} +diff --git a/vendor/golang.org/x/sys/unix/dev_dragonfly.go b/vendor/golang.org/x/sys/unix/dev_dragonfly.go +new file mode 100644 +index 00000000..8502f202 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_dragonfly.go +@@ -0,0 +1,30 @@ ++// 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. ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used in Dragonfly's sys/types.h header. ++// ++// The information below is extracted and adapted from sys/types.h: ++// ++// Minor gives a cookie instead of an index since in order to avoid changing the ++// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for ++// devices that don't use them. ++ ++package unix ++ ++// Major returns the major component of a DragonFlyBSD device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev >> 8) & 0xff) ++} ++ ++// Minor returns the minor component of a DragonFlyBSD device number. ++func Minor(dev uint64) uint32 { ++ return uint32(dev & 0xffff00ff) ++} ++ ++// Mkdev returns a DragonFlyBSD device number generated from the given major and ++// minor components. ++func Mkdev(major, minor uint32) uint64 { ++ return (uint64(major) << 8) | uint64(minor) ++} +diff --git a/vendor/golang.org/x/sys/unix/dev_freebsd.go b/vendor/golang.org/x/sys/unix/dev_freebsd.go +new file mode 100644 +index 00000000..eba3b4bd +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_freebsd.go +@@ -0,0 +1,30 @@ ++// 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. ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used in FreeBSD's sys/types.h header. ++// ++// The information below is extracted and adapted from sys/types.h: ++// ++// Minor gives a cookie instead of an index since in order to avoid changing the ++// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for ++// devices that don't use them. ++ ++package unix ++ ++// Major returns the major component of a FreeBSD device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev >> 8) & 0xff) ++} ++ ++// Minor returns the minor component of a FreeBSD device number. ++func Minor(dev uint64) uint32 { ++ return uint32(dev & 0xffff00ff) ++} ++ ++// Mkdev returns a FreeBSD device number generated from the given major and ++// minor components. ++func Mkdev(major, minor uint32) uint64 { ++ return (uint64(major) << 8) | uint64(minor) ++} +diff --git a/vendor/golang.org/x/sys/unix/dev_linux.go b/vendor/golang.org/x/sys/unix/dev_linux.go +index c902c39e..d165d6f3 100644 +--- a/vendor/golang.org/x/sys/unix/dev_linux.go ++++ b/vendor/golang.org/x/sys/unix/dev_linux.go +@@ -34,9 +34,9 @@ func Minor(dev uint64) uint32 { + // Mkdev returns a Linux device number generated from the given major and minor + // components. + func Mkdev(major, minor uint32) uint64 { +- dev := uint64((major & 0x00000fff) << 8) +- dev |= uint64((major & 0xfffff000) << 32) +- dev |= uint64((minor & 0x000000ff) << 0) +- dev |= uint64((minor & 0xffffff00) << 12) ++ dev := (uint64(major) & 0x00000fff) << 8 ++ dev |= (uint64(major) & 0xfffff000) << 32 ++ dev |= (uint64(minor) & 0x000000ff) << 0 ++ dev |= (uint64(minor) & 0xffffff00) << 12 + return dev + } +diff --git a/vendor/golang.org/x/sys/unix/dev_netbsd.go b/vendor/golang.org/x/sys/unix/dev_netbsd.go +new file mode 100644 +index 00000000..b4a203d0 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_netbsd.go +@@ -0,0 +1,29 @@ ++// 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. ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used in NetBSD's sys/types.h header. ++ ++package unix ++ ++// Major returns the major component of a NetBSD device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev & 0x000fff00) >> 8) ++} ++ ++// Minor returns the minor component of a NetBSD device number. ++func Minor(dev uint64) uint32 { ++ minor := uint32((dev & 0x000000ff) >> 0) ++ minor |= uint32((dev & 0xfff00000) >> 12) ++ return minor ++} ++ ++// Mkdev returns a NetBSD device number generated from the given major and minor ++// components. ++func Mkdev(major, minor uint32) uint64 { ++ dev := (uint64(major) << 8) & 0x000fff00 ++ dev |= (uint64(minor) << 12) & 0xfff00000 ++ dev |= (uint64(minor) << 0) & 0x000000ff ++ return dev ++} +diff --git a/vendor/golang.org/x/sys/unix/dev_openbsd.go b/vendor/golang.org/x/sys/unix/dev_openbsd.go +new file mode 100644 +index 00000000..f3430c42 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/dev_openbsd.go +@@ -0,0 +1,29 @@ ++// 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. ++ ++// Functions to access/create device major and minor numbers matching the ++// encoding used in OpenBSD's sys/types.h header. ++ ++package unix ++ ++// Major returns the major component of an OpenBSD device number. ++func Major(dev uint64) uint32 { ++ return uint32((dev & 0x0000ff00) >> 8) ++} ++ ++// Minor returns the minor component of an OpenBSD device number. ++func Minor(dev uint64) uint32 { ++ minor := uint32((dev & 0x000000ff) >> 0) ++ minor |= uint32((dev & 0xffff0000) >> 8) ++ return minor ++} ++ ++// Mkdev returns an OpenBSD device number generated from the given major and minor ++// components. ++func Mkdev(major, minor uint32) uint64 { ++ dev := (uint64(major) << 8) & 0x0000ff00 ++ dev |= (uint64(minor) << 8) & 0xffff0000 ++ dev |= (uint64(minor) << 0) & 0x000000ff ++ return dev ++} +diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go +index bd475812..304016b6 100644 +--- a/vendor/golang.org/x/sys/unix/dirent.go ++++ b/vendor/golang.org/x/sys/unix/dirent.go +@@ -2,7 +2,7 @@ + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + +-// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + + package unix + +diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go +index 085df2d8..bcdb5d30 100644 +--- a/vendor/golang.org/x/sys/unix/endian_little.go ++++ b/vendor/golang.org/x/sys/unix/endian_little.go +@@ -2,7 +2,7 @@ + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + // +-// +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le ++// +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le riscv64 + + package unix + +diff --git a/vendor/golang.org/x/sys/unix/env_unix.go b/vendor/golang.org/x/sys/unix/env_unix.go +index 45e281a0..84178b0a 100644 +--- a/vendor/golang.org/x/sys/unix/env_unix.go ++++ b/vendor/golang.org/x/sys/unix/env_unix.go +@@ -1,8 +1,8 @@ +-// Copyright 2010 The Go Authors. All rights reserved. ++// 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 darwin dragonfly freebsd linux netbsd openbsd solaris ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + + // Unix environment variables. + +@@ -25,3 +25,7 @@ func Clearenv() { + func Environ() []string { + return syscall.Environ() + } ++ ++func Unsetenv(key string) error { ++ return syscall.Unsetenv(key) ++} +diff --git a/vendor/golang.org/x/sys/unix/env_unset.go b/vendor/golang.org/x/sys/unix/env_unset.go +deleted file mode 100644 +index 92222625..00000000 +--- a/vendor/golang.org/x/sys/unix/env_unset.go ++++ /dev/null +@@ -1,14 +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. +- +-// +build go1.4 +- +-package unix +- +-import "syscall" +- +-func Unsetenv(key string) error { +- // This was added in Go 1.4. +- return syscall.Unsetenv(key) +-} +diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_386.go b/vendor/golang.org/x/sys/unix/errors_freebsd_386.go +index c56bc8b0..761db66e 100644 +--- a/vendor/golang.org/x/sys/unix/errors_freebsd_386.go ++++ b/vendor/golang.org/x/sys/unix/errors_freebsd_386.go +@@ -8,6 +8,7 @@ + package unix + + const ( ++ DLT_HHDLC = 0x79 + IFF_SMART = 0x20 + IFT_1822 = 0x2 + IFT_A12MPPSWITCH = 0x82 +@@ -210,13 +211,18 @@ const ( + IFT_XETHER = 0x1a + IPPROTO_MAXID = 0x34 + IPV6_FAITH = 0x1d ++ IPV6_MIN_MEMBERSHIPS = 0x1f + IP_FAITH = 0x16 ++ IP_MAX_SOURCE_FILTER = 0x400 ++ IP_MIN_MEMBERSHIPS = 0x1f + MAP_NORESERVE = 0x40 + MAP_RENAME = 0x20 + NET_RT_MAXID = 0x6 + RTF_PRCLONING = 0x10000 + RTM_OLDADD = 0x9 + RTM_OLDDEL = 0xa ++ RT_CACHING_CONTEXT = 0x1 ++ RT_NORTREF = 0x2 + SIOCADDRT = 0x8030720a + SIOCALIFADDR = 0x8118691b + SIOCDELRT = 0x8030720b +diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go +index 3e977117..070f44b6 100644 +--- a/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go ++++ b/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go +@@ -8,6 +8,7 @@ + package unix + + const ( ++ DLT_HHDLC = 0x79 + IFF_SMART = 0x20 + IFT_1822 = 0x2 + IFT_A12MPPSWITCH = 0x82 +@@ -210,13 +211,18 @@ const ( + IFT_XETHER = 0x1a + IPPROTO_MAXID = 0x34 + IPV6_FAITH = 0x1d ++ IPV6_MIN_MEMBERSHIPS = 0x1f + IP_FAITH = 0x16 ++ IP_MAX_SOURCE_FILTER = 0x400 ++ IP_MIN_MEMBERSHIPS = 0x1f + MAP_NORESERVE = 0x40 + MAP_RENAME = 0x20 + NET_RT_MAXID = 0x6 + RTF_PRCLONING = 0x10000 + RTM_OLDADD = 0x9 + RTM_OLDDEL = 0xa ++ RT_CACHING_CONTEXT = 0x1 ++ RT_NORTREF = 0x2 + SIOCADDRT = 0x8040720a + SIOCALIFADDR = 0x8118691b + SIOCDELRT = 0x8040720b +diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go +new file mode 100644 +index 00000000..946dcf3f +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go +@@ -0,0 +1,17 @@ ++// Copyright 2020 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep ++// them here for backwards compatibility. ++ ++package unix ++ ++const ( ++ DLT_HHDLC = 0x79 ++ IPV6_MIN_MEMBERSHIPS = 0x1f ++ IP_MAX_SOURCE_FILTER = 0x400 ++ IP_MIN_MEMBERSHIPS = 0x1f ++ RT_CACHING_CONTEXT = 0x1 ++ RT_NORTREF = 0x2 ++) +diff --git a/vendor/golang.org/x/sys/unix/flock.go b/vendor/golang.org/x/sys/unix/fcntl.go +similarity index 54% +rename from vendor/golang.org/x/sys/unix/flock.go +rename to vendor/golang.org/x/sys/unix/fcntl.go +index 2994ce75..4dc53486 100644 +--- a/vendor/golang.org/x/sys/unix/flock.go ++++ b/vendor/golang.org/x/sys/unix/fcntl.go +@@ -2,16 +2,30 @@ + // 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 + + import "unsafe" + + // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux +-// systems by flock_linux_32bit.go to be SYS_FCNTL64. ++// systems by fcntl_linux_32bit.go to be SYS_FCNTL64. + var fcntl64Syscall uintptr = SYS_FCNTL + ++func fcntl(fd int, cmd, arg int) (int, error) { ++ valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) ++ var err error ++ if errno != 0 { ++ err = errno ++ } ++ return int(valptr), err ++} ++ ++// 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 { + _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) +diff --git a/vendor/golang.org/x/sys/unix/fcntl_darwin.go b/vendor/golang.org/x/sys/unix/fcntl_darwin.go +new file mode 100644 +index 00000000..5868a4a4 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/fcntl_darwin.go +@@ -0,0 +1,18 @@ ++// Copyright 2019 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++package unix ++ ++import "unsafe" ++ ++// FcntlInt performs a fcntl syscall on fd with the provided command and argument. ++func FcntlInt(fd uintptr, cmd, arg int) (int, error) { ++ return fcntl(int(fd), cmd, arg) ++} ++ ++// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. ++func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { ++ _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) ++ return err ++} +diff --git a/vendor/golang.org/x/sys/unix/flock_linux_32bit.go b/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +similarity index 100% +rename from vendor/golang.org/x/sys/unix/flock_linux_32bit.go +rename to vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go +new file mode 100644 +index 00000000..b27be0a0 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/fdset.go +@@ -0,0 +1,29 @@ ++// 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. ++ ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris ++ ++package unix ++ ++// Set adds fd to the set fds. ++func (fds *FdSet) Set(fd int) { ++ fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) ++} ++ ++// Clear removes fd from the set fds. ++func (fds *FdSet) Clear(fd int) { ++ fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) ++} ++ ++// IsSet returns whether fd is in the set fds. ++func (fds *FdSet) IsSet(fd int) bool { ++ return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 ++} ++ ++// Zero clears the set fds. ++func (fds *FdSet) Zero() { ++ for i := range fds.Bits { ++ fds.Bits[i] = 0 ++ } ++} +diff --git a/vendor/golang.org/x/sys/unix/file_unix.go b/vendor/golang.org/x/sys/unix/file_unix.go +deleted file mode 100644 +index 47f6a83f..00000000 +--- a/vendor/golang.org/x/sys/unix/file_unix.go ++++ /dev/null +@@ -1,27 +0,0 @@ +-// Copyright 2017 The Go Authors. All rights reserved. +-// Use of this source code is governed by a BSD-style +-// license that can be found in the LICENSE file. +- +-package unix +- +-import ( +- "os" +- "syscall" +-) +- +-// FIXME: unexported function from os +-// syscallMode returns the syscall-specific mode bits from Go's portable mode bits. +-func syscallMode(i os.FileMode) (o uint32) { +- o |= uint32(i.Perm()) +- if i&os.ModeSetuid != 0 { +- o |= syscall.S_ISUID +- } +- if i&os.ModeSetgid != 0 { +- o |= syscall.S_ISGID +- } +- if i&os.ModeSticky != 0 { +- o |= syscall.S_ISVTX +- } +- // No mapping for Go's ModeTemporary (plan9 only). +- return +-} +diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go +index 94c82321..cd6f5a61 100644 +--- a/vendor/golang.org/x/sys/unix/gccgo.go ++++ b/vendor/golang.org/x/sys/unix/gccgo.go +@@ -1,19 +1,30 @@ +-// Copyright 2015 The Go Authors. All rights reserved. ++// 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. + + // +build gccgo ++// +build !aix + + package unix + + import "syscall" + +-// We can't use the gc-syntax .s files for gccgo. On the plus side ++// We can't use the gc-syntax .s files for gccgo. On the plus side + // much of the functionality can be written directly in Go. + ++//extern gccgoRealSyscallNoError ++func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr) ++ + //extern gccgoRealSyscall + func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) + ++func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { ++ syscall.Entersyscall() ++ r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) ++ syscall.Exitsyscall() ++ return r, 0 ++} ++ + func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { + syscall.Entersyscall() + r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) +@@ -35,6 +46,11 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, + return r, 0, syscall.Errno(errno) + } + ++func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { ++ r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) ++ return r, 0 ++} ++ + func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { + r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) + return r, 0, syscall.Errno(errno) +diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/vendor/golang.org/x/sys/unix/gccgo_c.c +index 07f6be03..c44730c5 100644 +--- a/vendor/golang.org/x/sys/unix/gccgo_c.c ++++ b/vendor/golang.org/x/sys/unix/gccgo_c.c +@@ -1,8 +1,9 @@ +-// Copyright 2015 The Go Authors. All rights reserved. ++// 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. + + // +build gccgo ++// +build !aix + + #include <errno.h> + #include <stdint.h> +@@ -31,11 +32,8 @@ gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintp + return r; + } + +-// Define the use function in C so that it is not inlined. +- +-extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); +- +-void +-use(void *p __attribute__ ((unused))) ++uintptr_t ++gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) + { ++ return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); + } +diff --git a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +index bffe1a77..251a977a 100644 +--- a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go ++++ b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +@@ -1,4 +1,4 @@ +-// Copyright 2015 The Go Authors. All rights reserved. ++// 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. + +diff --git a/vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go b/vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go +deleted file mode 100644 +index 56332692..00000000 +--- a/vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go ++++ /dev/null +@@ -1,20 +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 gccgo,linux,sparc64 +- +-package unix +- +-import "syscall" +- +-//extern sysconf +-func realSysconf(name int) int64 +- +-func sysconf(name int) (n int64, err syscall.Errno) { +- r := realSysconf(name) +- if r < 0 { +- return 0, syscall.GetErrno() +- } +- return r, 0 +-} +diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl.go +new file mode 100644 +index 00000000..3559e5dc +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/ioctl.go +@@ -0,0 +1,65 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris ++ ++package unix ++ ++import ( ++ "runtime" ++ "unsafe" ++) ++ ++// 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)) ++} ++ ++// 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 := ioctl(fd, req, uintptr(unsafe.Pointer(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 := ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++ runtime.KeepAlive(value) ++ return err ++} ++ ++// IoctlGetInt performs an ioctl operation which gets an integer value ++// from fd, using the specified request number. ++// ++// A few ioctl requests use the return value as an output parameter; ++// for those, IoctlRetInt should be used instead of this function. ++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 ++} +diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go +new file mode 100644 +index 00000000..6f7bb6ed +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mkasm_darwin.go +@@ -0,0 +1,78 @@ ++// Copyright 2018 The Go 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 ++ ++// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go. ++//This program must be run after mksyscall.go. ++package main ++ ++import ( ++ "bytes" ++ "fmt" ++ "io/ioutil" ++ "log" ++ "os" ++ "strings" ++) ++ ++func writeASMFile(in string, fileName string, buildTags string) { ++ trampolines := map[string]bool{} ++ ++ var out bytes.Buffer ++ ++ fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " ")) ++ fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n") ++ fmt.Fprintf(&out, "\n") ++ fmt.Fprintf(&out, "// +build %s\n", buildTags) ++ fmt.Fprintf(&out, "\n") ++ fmt.Fprintf(&out, "#include \"textflag.h\"\n") ++ for _, line := range strings.Split(in, "\n") { ++ if !strings.HasPrefix(line, "func ") || !strings.HasSuffix(line, "_trampoline()") { ++ continue ++ } ++ fn := line[5 : len(line)-13] ++ if !trampolines[fn] { ++ trampolines[fn] = true ++ fmt.Fprintf(&out, "TEXT ·%s_trampoline(SB),NOSPLIT,$0-0\n", fn) ++ fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn) ++ } ++ } ++ err := ioutil.WriteFile(fileName, out.Bytes(), 0644) ++ if err != nil { ++ log.Fatalf("can't write %s: %s", fileName, err) ++ } ++} ++ ++func main() { ++ in1, err := ioutil.ReadFile("syscall_darwin.go") ++ if err != nil { ++ log.Fatalf("can't open syscall_darwin.go: %s", err) ++ } ++ arch := os.Args[1] ++ in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch)) ++ if err != nil { ++ log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err) ++ } ++ in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch)) ++ if err != nil { ++ log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err) ++ } ++ in := string(in1) + string(in2) + string(in3) ++ ++ writeASMFile(in, fmt.Sprintf("zsyscall_darwin_%s.s", arch), "go1.12") ++ ++ in1, err = ioutil.ReadFile("syscall_darwin.1_13.go") ++ if err != nil { ++ log.Fatalf("can't open syscall_darwin.1_13.go: %s", err) ++ } ++ in2, err = ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.1_13.go", arch)) ++ if err != nil { ++ log.Fatalf("can't open zsyscall_darwin_%s.1_13.go: %s", arch, err) ++ } ++ ++ in = string(in1) + string(in2) ++ ++ writeASMFile(in, fmt.Sprintf("zsyscall_darwin_%s.1_13.s", arch), "go1.13") ++} +diff --git a/vendor/golang.org/x/sys/unix/mkmerge.go b/vendor/golang.org/x/sys/unix/mkmerge.go +new file mode 100644 +index 00000000..8bde4501 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mkmerge.go +@@ -0,0 +1,521 @@ ++// Copyright 2020 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build ignore ++ ++// mkmerge.go parses generated source files and merges common ++// consts, funcs, and types into a common source file, per GOOS. ++// ++// Usage: ++// $ go run mkmerge.go -out MERGED FILE [FILE ...] ++// ++// Example: ++// # Remove all common consts, funcs, and types from zerrors_linux_*.go ++// # and write the common code into zerrors_linux.go ++// $ go run mkmerge.go -out zerrors_linux.go zerrors_linux_*.go ++// ++// mkmerge.go performs the merge in the following steps: ++// 1. Construct the set of common code that is idential in all ++// architecture-specific files. ++// 2. Write this common code to the merged file. ++// 3. Remove the common code from all architecture-specific files. ++package main ++ ++import ( ++ "bufio" ++ "bytes" ++ "flag" ++ "fmt" ++ "go/ast" ++ "go/format" ++ "go/parser" ++ "go/token" ++ "io" ++ "io/ioutil" ++ "log" ++ "os" ++ "path" ++ "path/filepath" ++ "regexp" ++ "strconv" ++ "strings" ++) ++ ++const validGOOS = "aix|darwin|dragonfly|freebsd|linux|netbsd|openbsd|solaris" ++ ++// getValidGOOS returns GOOS, true if filename ends with a valid "_GOOS.go" ++func getValidGOOS(filename string) (string, bool) { ++ matches := regexp.MustCompile(`_(` + validGOOS + `)\.go$`).FindStringSubmatch(filename) ++ if len(matches) != 2 { ++ return "", false ++ } ++ return matches[1], true ++} ++ ++// codeElem represents an ast.Decl in a comparable way. ++type codeElem struct { ++ tok token.Token // e.g. token.CONST, token.TYPE, or token.FUNC ++ src string // the declaration formatted as source code ++} ++ ++// newCodeElem returns a codeElem based on tok and node, or an error is returned. ++func newCodeElem(tok token.Token, node ast.Node) (codeElem, error) { ++ var b strings.Builder ++ err := format.Node(&b, token.NewFileSet(), node) ++ if err != nil { ++ return codeElem{}, err ++ } ++ return codeElem{tok, b.String()}, nil ++} ++ ++// codeSet is a set of codeElems ++type codeSet struct { ++ set map[codeElem]bool // true for all codeElems in the set ++} ++ ++// newCodeSet returns a new codeSet ++func newCodeSet() *codeSet { return &codeSet{make(map[codeElem]bool)} } ++ ++// add adds elem to c ++func (c *codeSet) add(elem codeElem) { c.set[elem] = true } ++ ++// has returns true if elem is in c ++func (c *codeSet) has(elem codeElem) bool { return c.set[elem] } ++ ++// isEmpty returns true if the set is empty ++func (c *codeSet) isEmpty() bool { return len(c.set) == 0 } ++ ++// intersection returns a new set which is the intersection of c and a ++func (c *codeSet) intersection(a *codeSet) *codeSet { ++ res := newCodeSet() ++ ++ for elem := range c.set { ++ if a.has(elem) { ++ res.add(elem) ++ } ++ } ++ return res ++} ++ ++// keepCommon is a filterFn for filtering the merged file with common declarations. ++func (c *codeSet) keepCommon(elem codeElem) bool { ++ switch elem.tok { ++ case token.VAR: ++ // Remove all vars from the merged file ++ return false ++ case token.CONST, token.TYPE, token.FUNC, token.COMMENT: ++ // Remove arch-specific consts, types, functions, and file-level comments from the merged file ++ return c.has(elem) ++ case token.IMPORT: ++ // Keep imports, they are handled by filterImports ++ return true ++ } ++ ++ log.Fatalf("keepCommon: invalid elem %v", elem) ++ return true ++} ++ ++// keepArchSpecific is a filterFn for filtering the GOARC-specific files. ++func (c *codeSet) keepArchSpecific(elem codeElem) bool { ++ switch elem.tok { ++ case token.CONST, token.TYPE, token.FUNC: ++ // Remove common consts, types, or functions from the arch-specific file ++ return !c.has(elem) ++ } ++ return true ++} ++ ++// srcFile represents a source file ++type srcFile struct { ++ name string ++ src []byte ++} ++ ++// filterFn is a helper for filter ++type filterFn func(codeElem) bool ++ ++// filter parses and filters Go source code from src, removing top ++// level declarations using keep as predicate. ++// For src parameter, please see docs for parser.ParseFile. ++func filter(src interface{}, keep filterFn) ([]byte, error) { ++ // Parse the src into an ast ++ fset := token.NewFileSet() ++ f, err := parser.ParseFile(fset, "", src, parser.ParseComments) ++ if err != nil { ++ return nil, err ++ } ++ cmap := ast.NewCommentMap(fset, f, f.Comments) ++ ++ // Group const/type specs on adjacent lines ++ var groups specGroups = make(map[string]int) ++ var groupID int ++ ++ decls := f.Decls ++ f.Decls = f.Decls[:0] ++ for _, decl := range decls { ++ switch decl := decl.(type) { ++ case *ast.GenDecl: ++ // Filter imports, consts, types, vars ++ specs := decl.Specs ++ decl.Specs = decl.Specs[:0] ++ for i, spec := range specs { ++ elem, err := newCodeElem(decl.Tok, spec) ++ if err != nil { ++ return nil, err ++ } ++ ++ // Create new group if there are empty lines between this and the previous spec ++ if i > 0 && fset.Position(specs[i-1].End()).Line < fset.Position(spec.Pos()).Line-1 { ++ groupID++ ++ } ++ ++ // Check if we should keep this spec ++ if keep(elem) { ++ decl.Specs = append(decl.Specs, spec) ++ groups.add(elem.src, groupID) ++ } ++ } ++ // Check if we should keep this decl ++ if len(decl.Specs) > 0 { ++ f.Decls = append(f.Decls, decl) ++ } ++ case *ast.FuncDecl: ++ // Filter funcs ++ elem, err := newCodeElem(token.FUNC, decl) ++ if err != nil { ++ return nil, err ++ } ++ if keep(elem) { ++ f.Decls = append(f.Decls, decl) ++ } ++ } ++ } ++ ++ // Filter file level comments ++ if cmap[f] != nil { ++ commentGroups := cmap[f] ++ cmap[f] = cmap[f][:0] ++ for _, cGrp := range commentGroups { ++ if keep(codeElem{token.COMMENT, cGrp.Text()}) { ++ cmap[f] = append(cmap[f], cGrp) ++ } ++ } ++ } ++ f.Comments = cmap.Filter(f).Comments() ++ ++ // Generate code for the filtered ast ++ var buf bytes.Buffer ++ if err = format.Node(&buf, fset, f); err != nil { ++ return nil, err ++ } ++ ++ groupedSrc, err := groups.filterEmptyLines(&buf) ++ if err != nil { ++ return nil, err ++ } ++ ++ return filterImports(groupedSrc) ++} ++ ++// getCommonSet returns the set of consts, types, and funcs that are present in every file. ++func getCommonSet(files []srcFile) (*codeSet, error) { ++ if len(files) == 0 { ++ return nil, fmt.Errorf("no files provided") ++ } ++ // Use the first architecture file as the baseline ++ baseSet, err := getCodeSet(files[0].src) ++ if err != nil { ++ return nil, err ++ } ++ ++ // Compare baseline set with other architecture files: discard any element, ++ // that doesn't exist in other architecture files. ++ for _, f := range files[1:] { ++ set, err := getCodeSet(f.src) ++ if err != nil { ++ return nil, err ++ } ++ ++ baseSet = baseSet.intersection(set) ++ } ++ return baseSet, nil ++} ++ ++// getCodeSet returns the set of all top-level consts, types, and funcs from src. ++// src must be string, []byte, or io.Reader (see go/parser.ParseFile docs) ++func getCodeSet(src interface{}) (*codeSet, error) { ++ set := newCodeSet() ++ ++ fset := token.NewFileSet() ++ f, err := parser.ParseFile(fset, "", src, parser.ParseComments) ++ if err != nil { ++ return nil, err ++ } ++ ++ for _, decl := range f.Decls { ++ switch decl := decl.(type) { ++ case *ast.GenDecl: ++ // Add const, and type declarations ++ if !(decl.Tok == token.CONST || decl.Tok == token.TYPE) { ++ break ++ } ++ ++ for _, spec := range decl.Specs { ++ elem, err := newCodeElem(decl.Tok, spec) ++ if err != nil { ++ return nil, err ++ } ++ ++ set.add(elem) ++ } ++ case *ast.FuncDecl: ++ // Add func declarations ++ elem, err := newCodeElem(token.FUNC, decl) ++ if err != nil { ++ return nil, err ++ } ++ ++ set.add(elem) ++ } ++ } ++ ++ // Add file level comments ++ cmap := ast.NewCommentMap(fset, f, f.Comments) ++ for _, cGrp := range cmap[f] { ++ set.add(codeElem{token.COMMENT, cGrp.Text()}) ++ } ++ ++ return set, nil ++} ++ ++// importName returns the identifier (PackageName) for an imported package ++func importName(iSpec *ast.ImportSpec) (string, error) { ++ if iSpec.Name == nil { ++ name, err := strconv.Unquote(iSpec.Path.Value) ++ if err != nil { ++ return "", err ++ } ++ return path.Base(name), nil ++ } ++ return iSpec.Name.Name, nil ++} ++ ++// specGroups tracks grouped const/type specs with a map of line: groupID pairs ++type specGroups map[string]int ++ ++// add spec source to group ++func (s specGroups) add(src string, groupID int) error { ++ srcBytes, err := format.Source(bytes.TrimSpace([]byte(src))) ++ if err != nil { ++ return err ++ } ++ s[string(srcBytes)] = groupID ++ return nil ++} ++ ++// filterEmptyLines removes empty lines within groups of const/type specs. ++// Returns the filtered source. ++func (s specGroups) filterEmptyLines(src io.Reader) ([]byte, error) { ++ scanner := bufio.NewScanner(src) ++ var out bytes.Buffer ++ ++ var emptyLines bytes.Buffer ++ prevGroupID := -1 // Initialize to invalid group ++ for scanner.Scan() { ++ line := bytes.TrimSpace(scanner.Bytes()) ++ ++ if len(line) == 0 { ++ fmt.Fprintf(&emptyLines, "%s\n", scanner.Bytes()) ++ continue ++ } ++ ++ // Discard emptyLines if previous non-empty line belonged to the same ++ // group as this line ++ if src, err := format.Source(line); err == nil { ++ groupID, ok := s[string(src)] ++ if ok && groupID == prevGroupID { ++ emptyLines.Reset() ++ } ++ prevGroupID = groupID ++ } ++ ++ emptyLines.WriteTo(&out) ++ fmt.Fprintf(&out, "%s\n", scanner.Bytes()) ++ } ++ if err := scanner.Err(); err != nil { ++ return nil, err ++ } ++ return out.Bytes(), nil ++} ++ ++// filterImports removes unused imports from fileSrc, and returns a formatted src. ++func filterImports(fileSrc []byte) ([]byte, error) { ++ fset := token.NewFileSet() ++ file, err := parser.ParseFile(fset, "", fileSrc, parser.ParseComments) ++ if err != nil { ++ return nil, err ++ } ++ cmap := ast.NewCommentMap(fset, file, file.Comments) ++ ++ // create set of references to imported identifiers ++ keepImport := make(map[string]bool) ++ for _, u := range file.Unresolved { ++ keepImport[u.Name] = true ++ } ++ ++ // filter import declarations ++ decls := file.Decls ++ file.Decls = file.Decls[:0] ++ for _, decl := range decls { ++ importDecl, ok := decl.(*ast.GenDecl) ++ ++ // Keep non-import declarations ++ if !ok || importDecl.Tok != token.IMPORT { ++ file.Decls = append(file.Decls, decl) ++ continue ++ } ++ ++ // Filter the import specs ++ specs := importDecl.Specs ++ importDecl.Specs = importDecl.Specs[:0] ++ for _, spec := range specs { ++ iSpec := spec.(*ast.ImportSpec) ++ name, err := importName(iSpec) ++ if err != nil { ++ return nil, err ++ } ++ ++ if keepImport[name] { ++ importDecl.Specs = append(importDecl.Specs, iSpec) ++ } ++ } ++ if len(importDecl.Specs) > 0 { ++ file.Decls = append(file.Decls, importDecl) ++ } ++ } ++ ++ // filter file.Imports ++ imports := file.Imports ++ file.Imports = file.Imports[:0] ++ for _, spec := range imports { ++ name, err := importName(spec) ++ if err != nil { ++ return nil, err ++ } ++ ++ if keepImport[name] { ++ file.Imports = append(file.Imports, spec) ++ } ++ } ++ file.Comments = cmap.Filter(file).Comments() ++ ++ var buf bytes.Buffer ++ err = format.Node(&buf, fset, file) ++ if err != nil { ++ return nil, err ++ } ++ ++ return buf.Bytes(), nil ++} ++ ++// merge extracts duplicate code from archFiles and merges it to mergeFile. ++// 1. Construct commonSet: the set of code that is idential in all archFiles. ++// 2. Write the code in commonSet to mergedFile. ++// 3. Remove the commonSet code from all archFiles. ++func merge(mergedFile string, archFiles ...string) error { ++ // extract and validate the GOOS part of the merged filename ++ goos, ok := getValidGOOS(mergedFile) ++ if !ok { ++ return fmt.Errorf("invalid GOOS in merged file name %s", mergedFile) ++ } ++ ++ // Read architecture files ++ var inSrc []srcFile ++ for _, file := range archFiles { ++ src, err := ioutil.ReadFile(file) ++ if err != nil { ++ return fmt.Errorf("cannot read archfile %s: %w", file, err) ++ } ++ ++ inSrc = append(inSrc, srcFile{file, src}) ++ } ++ ++ // 1. Construct the set of top-level declarations common for all files ++ commonSet, err := getCommonSet(inSrc) ++ if err != nil { ++ return err ++ } ++ if commonSet.isEmpty() { ++ // No common code => do not modify any files ++ return nil ++ } ++ ++ // 2. Write the merged file ++ mergedSrc, err := filter(inSrc[0].src, commonSet.keepCommon) ++ if err != nil { ++ return err ++ } ++ ++ f, err := os.Create(mergedFile) ++ if err != nil { ++ return err ++ } ++ ++ buf := bufio.NewWriter(f) ++ fmt.Fprintln(buf, "// Code generated by mkmerge.go; DO NOT EDIT.") ++ fmt.Fprintln(buf) ++ fmt.Fprintf(buf, "// +build %s\n", goos) ++ fmt.Fprintln(buf) ++ buf.Write(mergedSrc) ++ ++ err = buf.Flush() ++ if err != nil { ++ return err ++ } ++ err = f.Close() ++ if err != nil { ++ return err ++ } ++ ++ // 3. Remove duplicate declarations from the architecture files ++ for _, inFile := range inSrc { ++ src, err := filter(inFile.src, commonSet.keepArchSpecific) ++ if err != nil { ++ return err ++ } ++ err = ioutil.WriteFile(inFile.name, src, 0644) ++ if err != nil { ++ return err ++ } ++ } ++ return nil ++} ++ ++func main() { ++ var mergedFile string ++ flag.StringVar(&mergedFile, "out", "", "Write merged code to `FILE`") ++ flag.Parse() ++ ++ // Expand wildcards ++ var filenames []string ++ for _, arg := range flag.Args() { ++ matches, err := filepath.Glob(arg) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, "Invalid command line argument %q: %v\n", arg, err) ++ os.Exit(1) ++ } ++ filenames = append(filenames, matches...) ++ } ++ ++ if len(filenames) < 2 { ++ // No need to merge ++ return ++ } ++ ++ err := merge(mergedFile, filenames...) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, "Merge failed with error: %v\n", err) ++ os.Exit(1) ++ } ++} +diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go +index d3ff659b..5ee1a16b 100644 +--- a/vendor/golang.org/x/sys/unix/mkpost.go ++++ b/vendor/golang.org/x/sys/unix/mkpost.go +@@ -28,10 +28,10 @@ func main() { + if goarch == "" { + goarch = os.Getenv("GOARCH") + } +- // Check that we are using the new build system if we should be. +- if goos == "linux" && goarch != "sparc64" { ++ // Check that we are using the Docker-based build system if we should be. ++ if goos == "linux" { + if os.Getenv("GOLANG_SYS_BUILD") != "docker" { +- os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n") ++ os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n") + os.Stderr.WriteString("See README.md\n") + os.Exit(1) + } +@@ -42,6 +42,21 @@ func main() { + log.Fatal(err) + } + ++ if goos == "aix" { ++ // Replace type of Atim, Mtim and Ctim by Timespec in Stat_t ++ // to avoid having both StTimespec and Timespec. ++ sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`) ++ b = sttimespec.ReplaceAll(b, []byte("Timespec")) ++ } ++ ++ // Intentionally export __val fields in Fsid and Sigset_t ++ valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`) ++ b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}")) ++ ++ // Intentionally export __fds_bits field in FdSet ++ fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`) ++ b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}")) ++ + // If we have empty Ptrace structs, we should delete them. Only s390x emits + // nonempty Ptrace structs. + ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) +@@ -56,16 +71,31 @@ func main() { + removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`) + b = removeFieldsRegex.ReplaceAll(b, []byte("_")) + +- // We refuse to export private fields on s390x +- if goarch == "s390x" && goos == "linux" { +- // Remove cgo padding fields +- removeFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) +- b = removeFieldsRegex.ReplaceAll(b, []byte("_")) ++ // Convert [65]int8 to [65]byte in Utsname members to simplify ++ // conversion to string; see golang.org/issue/20753 ++ convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) ++ b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) + +- // Remove padding, hidden, or unused fields +- removeFieldsRegex = regexp.MustCompile(`X_\S+`) +- b = removeFieldsRegex.ReplaceAll(b, []byte("_")) +- } ++ // Convert [n]int8 to [n]byte in Statvfs_t members to simplify ++ // conversion to string. ++ convertStatvfsRegex := regexp.MustCompile(`((Fstype|Mnton|Mntfrom)name)(\s+)\[(\d+)\]int8`) ++ b = convertStatvfsRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) ++ ++ // Convert [1024]int8 to [1024]byte in Ptmget members ++ convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`) ++ b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte")) ++ ++ // Remove spare fields (e.g. in Statx_t) ++ spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) ++ b = spareFieldsRegex.ReplaceAll(b, []byte("_")) ++ ++ // Remove cgo padding fields ++ removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`) ++ b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_")) ++ ++ // Remove padding, hidden, or unused fields ++ removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`) ++ b = removeFieldsRegex.ReplaceAll(b, []byte("_")) + + // Remove the first line of warning from cgo + b = b[bytes.IndexByte(b, '\n')+1:] +@@ -78,6 +108,15 @@ func main() { + cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) + b = cgoCommandRegex.ReplaceAll(b, []byte(replacement)) + ++ // Rename Stat_t time fields ++ if goos == "freebsd" && goarch == "386" { ++ // Hide Stat_t.[AMCB]tim_ext fields ++ renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`) ++ b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_")) ++ } ++ renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`) ++ b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}")) ++ + // gofmt + b, err = format.Source(b) + if err != nil { +diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go +new file mode 100644 +index 00000000..9e540cc8 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mksyscall.go +@@ -0,0 +1,402 @@ ++// Copyright 2018 The Go 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 program reads a file containing function prototypes ++(like syscall_darwin.go) and generates system call bodies. ++The prototypes are marked by lines beginning with "//sys" ++and read like func declarations if //sys is replaced by func, but: ++ * The parameter lists must give a name for each argument. ++ This includes return parameters. ++ * The parameter lists must give a type for each argument: ++ the (x, y, z int) shorthand is not allowed. ++ * If the return parameter is an error number, it must be named errno. ++ ++A line beginning with //sysnb is like //sys, except that the ++goroutine will not be suspended during the execution of the system ++call. This must only be used for system calls which can never ++block, as otherwise the system call could cause all goroutines to ++hang. ++*/ ++package main ++ ++import ( ++ "bufio" ++ "flag" ++ "fmt" ++ "os" ++ "regexp" ++ "strings" ++) ++ ++var ( ++ b32 = flag.Bool("b32", false, "32bit big-endian") ++ l32 = flag.Bool("l32", false, "32bit little-endian") ++ plan9 = flag.Bool("plan9", false, "plan9") ++ openbsd = flag.Bool("openbsd", false, "openbsd") ++ netbsd = flag.Bool("netbsd", false, "netbsd") ++ dragonfly = flag.Bool("dragonfly", false, "dragonfly") ++ arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair ++ tags = flag.String("tags", "", "build tags") ++ filename = flag.String("output", "", "output file name (standard output if omitted)") ++) ++ ++// cmdLine returns this programs's commandline arguments ++func cmdLine() string { ++ return "go run mksyscall.go " + strings.Join(os.Args[1:], " ") ++} ++ ++// buildTags returns build tags ++func buildTags() string { ++ return *tags ++} ++ ++// Param is function parameter ++type Param struct { ++ Name string ++ Type string ++} ++ ++// usage prints the program usage ++func usage() { ++ fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n") ++ os.Exit(1) ++} ++ ++// parseParamList parses parameter list and returns a slice of parameters ++func parseParamList(list string) []string { ++ list = strings.TrimSpace(list) ++ if list == "" { ++ return []string{} ++ } ++ return regexp.MustCompile(`\s*,\s*`).Split(list, -1) ++} ++ ++// parseParam splits a parameter into name and type ++func parseParam(p string) Param { ++ ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) ++ if ps == nil { ++ fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) ++ os.Exit(1) ++ } ++ return Param{ps[1], ps[2]} ++} ++ ++func main() { ++ // Get the OS and architecture (using GOARCH_TARGET if it exists) ++ goos := os.Getenv("GOOS") ++ if goos == "" { ++ fmt.Fprintln(os.Stderr, "GOOS not defined in environment") ++ os.Exit(1) ++ } ++ goarch := os.Getenv("GOARCH_TARGET") ++ if goarch == "" { ++ goarch = os.Getenv("GOARCH") ++ } ++ ++ // Check that we are using the Docker-based build system if we should ++ if goos == "linux" { ++ if os.Getenv("GOLANG_SYS_BUILD") != "docker" { ++ fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n") ++ fmt.Fprintf(os.Stderr, "See README.md\n") ++ os.Exit(1) ++ } ++ } ++ ++ flag.Usage = usage ++ flag.Parse() ++ if len(flag.Args()) <= 0 { ++ fmt.Fprintf(os.Stderr, "no files to parse provided\n") ++ usage() ++ } ++ ++ endianness := "" ++ if *b32 { ++ endianness = "big-endian" ++ } else if *l32 { ++ endianness = "little-endian" ++ } ++ ++ libc := false ++ if goos == "darwin" && (strings.Contains(buildTags(), ",go1.12") || strings.Contains(buildTags(), ",go1.13")) { ++ libc = true ++ } ++ trampolines := map[string]bool{} ++ ++ text := "" ++ for _, path := range flag.Args() { ++ file, err := os.Open(path) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ s := bufio.NewScanner(file) ++ for s.Scan() { ++ t := s.Text() ++ t = strings.TrimSpace(t) ++ t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) ++ nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) ++ if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { ++ continue ++ } ++ ++ // Line must be of the form ++ // func Open(path string, mode int, perm int) (fd int, errno error) ++ // Split into name, in params, out params. ++ f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t) ++ if f == nil { ++ fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) ++ os.Exit(1) ++ } ++ funct, inps, outps, sysname := f[2], f[3], f[4], f[5] ++ ++ // ClockGettime doesn't have a syscall number on Darwin, only generate libc wrappers. ++ if goos == "darwin" && !libc && funct == "ClockGettime" { ++ continue ++ } ++ ++ // Split argument lists on comma. ++ in := parseParamList(inps) ++ out := parseParamList(outps) ++ ++ // Try in vain to keep people from editing this file. ++ // The theory is that they jump into the middle of the file ++ // without reading the header. ++ text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" ++ ++ // Go function header. ++ outDecl := "" ++ if len(out) > 0 { ++ outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", ")) ++ } ++ text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl) ++ ++ // Check if err return available ++ errvar := "" ++ for _, param := range out { ++ p := parseParam(param) ++ if p.Type == "error" { ++ errvar = p.Name ++ break ++ } ++ } ++ ++ // Prepare arguments to Syscall. ++ var args []string ++ n := 0 ++ for _, param := range in { ++ p := parseParam(param) ++ if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { ++ args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") ++ } else if p.Type == "string" && errvar != "" { ++ text += fmt.Sprintf("\tvar _p%d *byte\n", n) ++ text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name) ++ text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) ++ args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) ++ n++ ++ } else if p.Type == "string" { ++ fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") ++ text += fmt.Sprintf("\tvar _p%d *byte\n", n) ++ text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name) ++ args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) ++ n++ ++ } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { ++ // Convert slice into pointer, length. ++ // Have to be careful not to take address of &a[0] if len == 0: ++ // pass dummy pointer in that case. ++ // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). ++ text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n) ++ text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name) ++ text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n) ++ args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) ++ n++ ++ } else if p.Type == "int64" && (*openbsd || *netbsd) { ++ args = append(args, "0") ++ if endianness == "big-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) ++ } else if endianness == "little-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) ++ } ++ } else if p.Type == "int64" && *dragonfly { ++ if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil { ++ args = append(args, "0") ++ } ++ if endianness == "big-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) ++ } else if endianness == "little-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) ++ } ++ } else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" { ++ if len(args)%2 == 1 && *arm { ++ // arm abi specifies 64-bit argument uses ++ // (even, odd) pair ++ args = append(args, "0") ++ } ++ if endianness == "big-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) ++ } ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) ++ } ++ } ++ ++ // Determine which form to use; pad args with zeros. ++ asm := "Syscall" ++ if nonblock != nil { ++ if errvar == "" && goos == "linux" { ++ asm = "RawSyscallNoError" ++ } else { ++ asm = "RawSyscall" ++ } ++ } else { ++ if errvar == "" && goos == "linux" { ++ asm = "SyscallNoError" ++ } ++ } ++ if len(args) <= 3 { ++ for len(args) < 3 { ++ args = append(args, "0") ++ } ++ } else if len(args) <= 6 { ++ asm += "6" ++ for len(args) < 6 { ++ args = append(args, "0") ++ } ++ } else if len(args) <= 9 { ++ asm += "9" ++ for len(args) < 9 { ++ args = append(args, "0") ++ } ++ } else { ++ fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct) ++ } ++ ++ // System call number. ++ if sysname == "" { ++ sysname = "SYS_" + funct ++ sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) ++ sysname = strings.ToUpper(sysname) ++ } ++ ++ var libcFn string ++ if libc { ++ asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call ++ sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_ ++ sysname = strings.ToLower(sysname) // lowercase ++ libcFn = sysname ++ sysname = "funcPC(libc_" + sysname + "_trampoline)" ++ } ++ ++ // Actual call. ++ arglist := strings.Join(args, ", ") ++ call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist) ++ ++ // Assign return values. ++ body := "" ++ ret := []string{"_", "_", "_"} ++ doErrno := false ++ for i := 0; i < len(out); i++ { ++ p := parseParam(out[i]) ++ reg := "" ++ if p.Name == "err" && !*plan9 { ++ reg = "e1" ++ ret[2] = reg ++ doErrno = true ++ } else if p.Name == "err" && *plan9 { ++ ret[0] = "r0" ++ ret[2] = "e1" ++ break ++ } else { ++ reg = fmt.Sprintf("r%d", i) ++ ret[i] = reg ++ } ++ if p.Type == "bool" { ++ reg = fmt.Sprintf("%s != 0", reg) ++ } ++ if p.Type == "int64" && endianness != "" { ++ // 64-bit number in r1:r0 or r0:r1. ++ if i+2 > len(out) { ++ fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct) ++ } ++ if endianness == "big-endian" { ++ reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) ++ } else { ++ reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) ++ } ++ ret[i] = fmt.Sprintf("r%d", i) ++ ret[i+1] = fmt.Sprintf("r%d", i+1) ++ } ++ if reg != "e1" || *plan9 { ++ body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) ++ } ++ } ++ if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { ++ text += fmt.Sprintf("\t%s\n", call) ++ } else { ++ if errvar == "" && goos == "linux" { ++ // raw syscall without error on Linux, see golang.org/issue/22924 ++ text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call) ++ } else { ++ text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) ++ } ++ } ++ text += body ++ ++ if *plan9 && ret[2] == "e1" { ++ text += "\tif int32(r0) == -1 {\n" ++ text += "\t\terr = e1\n" ++ text += "\t}\n" ++ } else if doErrno { ++ text += "\tif e1 != 0 {\n" ++ text += "\t\terr = errnoErr(e1)\n" ++ text += "\t}\n" ++ } ++ text += "\treturn\n" ++ text += "}\n\n" ++ ++ if libc && !trampolines[libcFn] { ++ // some system calls share a trampoline, like read and readlen. ++ trampolines[libcFn] = true ++ // Declare assembly trampoline. ++ text += fmt.Sprintf("func libc_%s_trampoline()\n", libcFn) ++ // Assembly trampoline calls the libc_* function, which this magic ++ // redirects to use the function from libSystem. ++ text += fmt.Sprintf("//go:linkname libc_%s libc_%s\n", libcFn, libcFn) ++ text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn) ++ text += "\n" ++ } ++ } ++ if err := s.Err(); err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ file.Close() ++ } ++ fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) ++} ++ ++const srcTemplate = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++ ++package unix ++ ++import ( ++ "syscall" ++ "unsafe" ++) ++ ++var _ syscall.Errno ++ ++%s ++` +diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go +new file mode 100644 +index 00000000..3be3cdfc +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go +@@ -0,0 +1,415 @@ ++// 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. ++ ++// +build ignore ++ ++/* ++This program reads a file containing function prototypes ++(like syscall_aix.go) and generates system call bodies. ++The prototypes are marked by lines beginning with "//sys" ++and read like func declarations if //sys is replaced by func, but: ++ * The parameter lists must give a name for each argument. ++ This includes return parameters. ++ * The parameter lists must give a type for each argument: ++ the (x, y, z int) shorthand is not allowed. ++ * If the return parameter is an error number, it must be named err. ++ * If go func name needs to be different than its libc name, ++ * or the function is not in libc, name could be specified ++ * at the end, after "=" sign, like ++ //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt ++*/ ++package main ++ ++import ( ++ "bufio" ++ "flag" ++ "fmt" ++ "os" ++ "regexp" ++ "strings" ++) ++ ++var ( ++ b32 = flag.Bool("b32", false, "32bit big-endian") ++ l32 = flag.Bool("l32", false, "32bit little-endian") ++ aix = flag.Bool("aix", false, "aix") ++ tags = flag.String("tags", "", "build tags") ++) ++ ++// cmdLine returns this programs's commandline arguments ++func cmdLine() string { ++ return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ") ++} ++ ++// buildTags returns build tags ++func buildTags() string { ++ return *tags ++} ++ ++// Param is function parameter ++type Param struct { ++ Name string ++ Type string ++} ++ ++// usage prints the program usage ++func usage() { ++ fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n") ++ os.Exit(1) ++} ++ ++// parseParamList parses parameter list and returns a slice of parameters ++func parseParamList(list string) []string { ++ list = strings.TrimSpace(list) ++ if list == "" { ++ return []string{} ++ } ++ return regexp.MustCompile(`\s*,\s*`).Split(list, -1) ++} ++ ++// parseParam splits a parameter into name and type ++func parseParam(p string) Param { ++ ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) ++ if ps == nil { ++ fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) ++ os.Exit(1) ++ } ++ return Param{ps[1], ps[2]} ++} ++ ++func main() { ++ flag.Usage = usage ++ flag.Parse() ++ if len(flag.Args()) <= 0 { ++ fmt.Fprintf(os.Stderr, "no files to parse provided\n") ++ usage() ++ } ++ ++ endianness := "" ++ if *b32 { ++ endianness = "big-endian" ++ } else if *l32 { ++ endianness = "little-endian" ++ } ++ ++ pack := "" ++ text := "" ++ cExtern := "/*\n#include <stdint.h>\n#include <stddef.h>\n" ++ for _, path := range flag.Args() { ++ file, err := os.Open(path) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ s := bufio.NewScanner(file) ++ for s.Scan() { ++ t := s.Text() ++ t = strings.TrimSpace(t) ++ t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) ++ if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { ++ pack = p[1] ++ } ++ nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) ++ if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { ++ continue ++ } ++ ++ // Line must be of the form ++ // func Open(path string, mode int, perm int) (fd int, err error) ++ // Split into name, in params, out params. ++ f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) ++ if f == nil { ++ fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) ++ os.Exit(1) ++ } ++ funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] ++ ++ // Split argument lists on comma. ++ in := parseParamList(inps) ++ out := parseParamList(outps) ++ ++ inps = strings.Join(in, ", ") ++ outps = strings.Join(out, ", ") ++ ++ // Try in vain to keep people from editing this file. ++ // The theory is that they jump into the middle of the file ++ // without reading the header. ++ text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" ++ ++ // Check if value return, err return available ++ errvar := "" ++ retvar := "" ++ rettype := "" ++ for _, param := range out { ++ p := parseParam(param) ++ if p.Type == "error" { ++ errvar = p.Name ++ } else { ++ retvar = p.Name ++ rettype = p.Type ++ } ++ } ++ ++ // System call name. ++ if sysname == "" { ++ sysname = funct ++ } ++ sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) ++ sysname = strings.ToLower(sysname) // All libc functions are lowercase. ++ ++ cRettype := "" ++ if rettype == "unsafe.Pointer" { ++ cRettype = "uintptr_t" ++ } else if rettype == "uintptr" { ++ cRettype = "uintptr_t" ++ } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { ++ cRettype = "uintptr_t" ++ } else if rettype == "int" { ++ cRettype = "int" ++ } else if rettype == "int32" { ++ cRettype = "int" ++ } else if rettype == "int64" { ++ cRettype = "long long" ++ } else if rettype == "uint32" { ++ cRettype = "unsigned int" ++ } else if rettype == "uint64" { ++ cRettype = "unsigned long long" ++ } else { ++ cRettype = "int" ++ } ++ if sysname == "exit" { ++ cRettype = "void" ++ } ++ ++ // Change p.Types to c ++ var cIn []string ++ for _, param := range in { ++ p := parseParam(param) ++ if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { ++ cIn = append(cIn, "uintptr_t") ++ } else if p.Type == "string" { ++ cIn = append(cIn, "uintptr_t") ++ } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { ++ cIn = append(cIn, "uintptr_t", "size_t") ++ } else if p.Type == "unsafe.Pointer" { ++ cIn = append(cIn, "uintptr_t") ++ } else if p.Type == "uintptr" { ++ cIn = append(cIn, "uintptr_t") ++ } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { ++ cIn = append(cIn, "uintptr_t") ++ } else if p.Type == "int" { ++ cIn = append(cIn, "int") ++ } else if p.Type == "int32" { ++ cIn = append(cIn, "int") ++ } else if p.Type == "int64" { ++ cIn = append(cIn, "long long") ++ } else if p.Type == "uint32" { ++ cIn = append(cIn, "unsigned int") ++ } else if p.Type == "uint64" { ++ cIn = append(cIn, "unsigned long long") ++ } else { ++ cIn = append(cIn, "int") ++ } ++ } ++ ++ if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" { ++ if sysname == "select" { ++ // select is a keyword of Go. Its name is ++ // changed to c_select. ++ cExtern += "#define c_select select\n" ++ } ++ // Imports of system calls from libc ++ cExtern += fmt.Sprintf("%s %s", cRettype, sysname) ++ cIn := strings.Join(cIn, ", ") ++ cExtern += fmt.Sprintf("(%s);\n", cIn) ++ } ++ ++ // So file name. ++ if *aix { ++ if modname == "" { ++ modname = "libc.a/shr_64.o" ++ } else { ++ fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) ++ os.Exit(1) ++ } ++ } ++ ++ strconvfunc := "C.CString" ++ ++ // Go function header. ++ if outps != "" { ++ outps = fmt.Sprintf(" (%s)", outps) ++ } ++ if text != "" { ++ text += "\n" ++ } ++ ++ text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) ++ ++ // Prepare arguments to Syscall. ++ var args []string ++ n := 0 ++ argN := 0 ++ for _, param := range in { ++ p := parseParam(param) ++ if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { ++ args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))") ++ } else if p.Type == "string" && errvar != "" { ++ text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) ++ args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) ++ n++ ++ } else if p.Type == "string" { ++ fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") ++ text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name) ++ args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n)) ++ n++ ++ } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { ++ // Convert slice into pointer, length. ++ // Have to be careful not to take address of &a[0] if len == 0: ++ // pass nil in that case. ++ text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) ++ text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) ++ args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n)) ++ n++ ++ text += fmt.Sprintf("\tvar _p%d int\n", n) ++ text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name) ++ args = append(args, fmt.Sprintf("C.size_t(_p%d)", n)) ++ n++ ++ } else if p.Type == "int64" && endianness != "" { ++ if endianness == "big-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) ++ } ++ n++ ++ } else if p.Type == "bool" { ++ text += fmt.Sprintf("\tvar _p%d uint32\n", n) ++ text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) ++ args = append(args, fmt.Sprintf("_p%d", n)) ++ } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { ++ args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) ++ } else if p.Type == "unsafe.Pointer" { ++ args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name)) ++ } else if p.Type == "int" { ++ if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) { ++ args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name)) ++ } else if argN == 0 && funct == "fcntl" { ++ args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ } else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) { ++ args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) ++ } ++ } else if p.Type == "int32" { ++ args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) ++ } else if p.Type == "int64" { ++ args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name)) ++ } else if p.Type == "uint32" { ++ args = append(args, fmt.Sprintf("C.uint(%s)", p.Name)) ++ } else if p.Type == "uint64" { ++ args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name)) ++ } else if p.Type == "uintptr" { ++ args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("C.int(%s)", p.Name)) ++ } ++ argN++ ++ } ++ ++ // Actual call. ++ arglist := strings.Join(args, ", ") ++ call := "" ++ if sysname == "exit" { ++ if errvar != "" { ++ call += "er :=" ++ } else { ++ call += "" ++ } ++ } else if errvar != "" { ++ call += "r0,er :=" ++ } else if retvar != "" { ++ call += "r0,_ :=" ++ } else { ++ call += "" ++ } ++ if sysname == "select" { ++ // select is a keyword of Go. Its name is ++ // changed to c_select. ++ call += fmt.Sprintf("C.c_%s(%s)", sysname, arglist) ++ } else { ++ call += fmt.Sprintf("C.%s(%s)", sysname, arglist) ++ } ++ ++ // Assign return values. ++ body := "" ++ for i := 0; i < len(out); i++ { ++ p := parseParam(out[i]) ++ reg := "" ++ if p.Name == "err" { ++ reg = "e1" ++ } else { ++ reg = "r0" ++ } ++ if reg != "e1" { ++ body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) ++ } ++ } ++ ++ // verify return ++ if sysname != "exit" && errvar != "" { ++ if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil { ++ body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n" ++ body += fmt.Sprintf("\t\t%s = er\n", errvar) ++ body += "\t}\n" ++ } else { ++ body += "\tif (r0 ==-1 && er != nil) {\n" ++ body += fmt.Sprintf("\t\t%s = er\n", errvar) ++ body += "\t}\n" ++ } ++ } else if errvar != "" { ++ body += "\tif (er != nil) {\n" ++ body += fmt.Sprintf("\t\t%s = er\n", errvar) ++ body += "\t}\n" ++ } ++ ++ text += fmt.Sprintf("\t%s\n", call) ++ text += body ++ ++ text += "\treturn\n" ++ text += "}\n" ++ } ++ if err := s.Err(); err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ file.Close() ++ } ++ imp := "" ++ if pack != "unix" { ++ imp = "import \"golang.org/x/sys/unix\"\n" ++ ++ } ++ fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, cExtern, imp, text) ++} ++ ++const srcTemplate = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++ ++package %s ++ ++ ++%s ++*/ ++import "C" ++import ( ++ "unsafe" ++) ++ ++ ++%s ++ ++%s ++` +diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go +new file mode 100644 +index 00000000..c9600995 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go +@@ -0,0 +1,614 @@ ++// 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. ++ ++// +build ignore ++ ++/* ++This program reads a file containing function prototypes ++(like syscall_aix.go) and generates system call bodies. ++The prototypes are marked by lines beginning with "//sys" ++and read like func declarations if //sys is replaced by func, but: ++ * The parameter lists must give a name for each argument. ++ This includes return parameters. ++ * The parameter lists must give a type for each argument: ++ the (x, y, z int) shorthand is not allowed. ++ * If the return parameter is an error number, it must be named err. ++ * If go func name needs to be different than its libc name, ++ * or the function is not in libc, name could be specified ++ * at the end, after "=" sign, like ++ //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt ++ ++ ++This program will generate three files and handle both gc and gccgo implementation: ++ - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation) ++ - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6 ++ - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type. ++ ++ The generated code looks like this ++ ++zsyscall_aix_ppc64.go ++func asyscall(...) (n int, err error) { ++ // Pointer Creation ++ r1, e1 := callasyscall(...) ++ // Type Conversion ++ // Error Handler ++ return ++} ++ ++zsyscall_aix_ppc64_gc.go ++//go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o" ++//go:linkname libc_asyscall libc_asyscall ++var asyscall syscallFunc ++ ++func callasyscall(...) (r1 uintptr, e1 Errno) { ++ r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... ) ++ return ++} ++ ++zsyscall_aix_ppc64_ggcgo.go ++ ++// int asyscall(...) ++ ++import "C" ++ ++func callasyscall(...) (r1 uintptr, e1 Errno) { ++ r1 = uintptr(C.asyscall(...)) ++ e1 = syscall.GetErrno() ++ return ++} ++*/ ++ ++package main ++ ++import ( ++ "bufio" ++ "flag" ++ "fmt" ++ "io/ioutil" ++ "os" ++ "regexp" ++ "strings" ++) ++ ++var ( ++ b32 = flag.Bool("b32", false, "32bit big-endian") ++ l32 = flag.Bool("l32", false, "32bit little-endian") ++ aix = flag.Bool("aix", false, "aix") ++ tags = flag.String("tags", "", "build tags") ++) ++ ++// cmdLine returns this programs's commandline arguments ++func cmdLine() string { ++ return "go run mksyscall_aix_ppc64.go " + strings.Join(os.Args[1:], " ") ++} ++ ++// buildTags returns build tags ++func buildTags() string { ++ return *tags ++} ++ ++// Param is function parameter ++type Param struct { ++ Name string ++ Type string ++} ++ ++// usage prints the program usage ++func usage() { ++ fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc64.go [-b32 | -l32] [-tags x,y] [file ...]\n") ++ os.Exit(1) ++} ++ ++// parseParamList parses parameter list and returns a slice of parameters ++func parseParamList(list string) []string { ++ list = strings.TrimSpace(list) ++ if list == "" { ++ return []string{} ++ } ++ return regexp.MustCompile(`\s*,\s*`).Split(list, -1) ++} ++ ++// parseParam splits a parameter into name and type ++func parseParam(p string) Param { ++ ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) ++ if ps == nil { ++ fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) ++ os.Exit(1) ++ } ++ return Param{ps[1], ps[2]} ++} ++ ++func main() { ++ flag.Usage = usage ++ flag.Parse() ++ if len(flag.Args()) <= 0 { ++ fmt.Fprintf(os.Stderr, "no files to parse provided\n") ++ usage() ++ } ++ ++ endianness := "" ++ if *b32 { ++ endianness = "big-endian" ++ } else if *l32 { ++ endianness = "little-endian" ++ } ++ ++ pack := "" ++ // GCCGO ++ textgccgo := "" ++ cExtern := "/*\n#include <stdint.h>\n" ++ // GC ++ textgc := "" ++ dynimports := "" ++ linknames := "" ++ var vars []string ++ // COMMON ++ textcommon := "" ++ for _, path := range flag.Args() { ++ file, err := os.Open(path) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ s := bufio.NewScanner(file) ++ for s.Scan() { ++ t := s.Text() ++ t = strings.TrimSpace(t) ++ t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) ++ if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { ++ pack = p[1] ++ } ++ nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) ++ if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { ++ continue ++ } ++ ++ // Line must be of the form ++ // func Open(path string, mode int, perm int) (fd int, err error) ++ // Split into name, in params, out params. ++ f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) ++ if f == nil { ++ fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) ++ os.Exit(1) ++ } ++ funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] ++ ++ // Split argument lists on comma. ++ in := parseParamList(inps) ++ out := parseParamList(outps) ++ ++ inps = strings.Join(in, ", ") ++ outps = strings.Join(out, ", ") ++ ++ if sysname == "" { ++ sysname = funct ++ } ++ ++ onlyCommon := false ++ if funct == "readlen" || funct == "writelen" || funct == "FcntlInt" || funct == "FcntlFlock" { ++ // This function call another syscall which is already implemented. ++ // Therefore, the gc and gccgo part must not be generated. ++ onlyCommon = true ++ } ++ ++ // Try in vain to keep people from editing this file. ++ // The theory is that they jump into the middle of the file ++ // without reading the header. ++ ++ textcommon += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" ++ if !onlyCommon { ++ textgccgo += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" ++ textgc += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" ++ } ++ ++ // Check if value return, err return available ++ errvar := "" ++ rettype := "" ++ for _, param := range out { ++ p := parseParam(param) ++ if p.Type == "error" { ++ errvar = p.Name ++ } else { ++ rettype = p.Type ++ } ++ } ++ ++ sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`) ++ sysname = strings.ToLower(sysname) // All libc functions are lowercase. ++ ++ // GCCGO Prototype return type ++ cRettype := "" ++ if rettype == "unsafe.Pointer" { ++ cRettype = "uintptr_t" ++ } else if rettype == "uintptr" { ++ cRettype = "uintptr_t" ++ } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil { ++ cRettype = "uintptr_t" ++ } else if rettype == "int" { ++ cRettype = "int" ++ } else if rettype == "int32" { ++ cRettype = "int" ++ } else if rettype == "int64" { ++ cRettype = "long long" ++ } else if rettype == "uint32" { ++ cRettype = "unsigned int" ++ } else if rettype == "uint64" { ++ cRettype = "unsigned long long" ++ } else { ++ cRettype = "int" ++ } ++ if sysname == "exit" { ++ cRettype = "void" ++ } ++ ++ // GCCGO Prototype arguments type ++ var cIn []string ++ for i, param := range in { ++ p := parseParam(param) ++ if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { ++ cIn = append(cIn, "uintptr_t") ++ } else if p.Type == "string" { ++ cIn = append(cIn, "uintptr_t") ++ } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil { ++ cIn = append(cIn, "uintptr_t", "size_t") ++ } else if p.Type == "unsafe.Pointer" { ++ cIn = append(cIn, "uintptr_t") ++ } else if p.Type == "uintptr" { ++ cIn = append(cIn, "uintptr_t") ++ } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil { ++ cIn = append(cIn, "uintptr_t") ++ } else if p.Type == "int" { ++ if (i == 0 || i == 2) && funct == "fcntl" { ++ // These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock ++ cIn = append(cIn, "uintptr_t") ++ } else { ++ cIn = append(cIn, "int") ++ } ++ ++ } else if p.Type == "int32" { ++ cIn = append(cIn, "int") ++ } else if p.Type == "int64" { ++ cIn = append(cIn, "long long") ++ } else if p.Type == "uint32" { ++ cIn = append(cIn, "unsigned int") ++ } else if p.Type == "uint64" { ++ cIn = append(cIn, "unsigned long long") ++ } else { ++ cIn = append(cIn, "int") ++ } ++ } ++ ++ if !onlyCommon { ++ // GCCGO Prototype Generation ++ // Imports of system calls from libc ++ if sysname == "select" { ++ // select is a keyword of Go. Its name is ++ // changed to c_select. ++ cExtern += "#define c_select select\n" ++ } ++ cExtern += fmt.Sprintf("%s %s", cRettype, sysname) ++ cIn := strings.Join(cIn, ", ") ++ cExtern += fmt.Sprintf("(%s);\n", cIn) ++ } ++ // GC Library name ++ if modname == "" { ++ modname = "libc.a/shr_64.o" ++ } else { ++ fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct) ++ os.Exit(1) ++ } ++ sysvarname := fmt.Sprintf("libc_%s", sysname) ++ ++ if !onlyCommon { ++ // GC Runtime import of function to allow cross-platform builds. ++ dynimports += fmt.Sprintf("//go:cgo_import_dynamic %s %s \"%s\"\n", sysvarname, sysname, modname) ++ // GC Link symbol to proc address variable. ++ linknames += fmt.Sprintf("//go:linkname %s %s\n", sysvarname, sysvarname) ++ // GC Library proc address variable. ++ vars = append(vars, sysvarname) ++ } ++ ++ strconvfunc := "BytePtrFromString" ++ strconvtype := "*byte" ++ ++ // Go function header. ++ if outps != "" { ++ outps = fmt.Sprintf(" (%s)", outps) ++ } ++ if textcommon != "" { ++ textcommon += "\n" ++ } ++ ++ textcommon += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps) ++ ++ // Prepare arguments tocall. ++ var argscommon []string // Arguments in the common part ++ var argscall []string // Arguments for call prototype ++ var argsgc []string // Arguments for gc call (with syscall6) ++ var argsgccgo []string // Arguments for gccgo call (with C.name_of_syscall) ++ n := 0 ++ argN := 0 ++ for _, param := range in { ++ p := parseParam(param) ++ if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { ++ argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.Name)) ++ argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) ++ argsgc = append(argsgc, p.Name) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ } else if p.Type == "string" && errvar != "" { ++ textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) ++ textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) ++ textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) ++ ++ argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) ++ argscall = append(argscall, fmt.Sprintf("_p%d uintptr ", n)) ++ argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) ++ n++ ++ } else if p.Type == "string" { ++ fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") ++ textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) ++ textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) ++ textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) ++ ++ argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) ++ argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n)) ++ argsgc = append(argsgc, fmt.Sprintf("_p%d", n)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n)) ++ n++ ++ } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil { ++ // Convert slice into pointer, length. ++ // Have to be careful not to take address of &a[0] if len == 0: ++ // pass nil in that case. ++ textcommon += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1]) ++ textcommon += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) ++ argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("len(%s)", p.Name)) ++ argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n), fmt.Sprintf("_lenp%d int", n)) ++ argsgc = append(argsgc, fmt.Sprintf("_p%d", n), fmt.Sprintf("uintptr(_lenp%d)", n)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n), fmt.Sprintf("C.size_t(_lenp%d)", n)) ++ n++ ++ } else if p.Type == "int64" && endianness != "" { ++ fmt.Fprintf(os.Stderr, path+":"+funct+" uses int64 with 32 bits mode. Case not yet implemented\n") ++ } else if p.Type == "bool" { ++ fmt.Fprintf(os.Stderr, path+":"+funct+" uses bool. Case not yet implemented\n") ++ } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil || p.Type == "unsafe.Pointer" { ++ argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) ++ argsgc = append(argsgc, p.Name) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ } else if p.Type == "int" { ++ if (argN == 0 || argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt") || (funct == "FcntlFlock")) { ++ // These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock ++ argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) ++ argsgc = append(argsgc, p.Name) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ ++ } else { ++ argscommon = append(argscommon, p.Name) ++ argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) ++ argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) ++ } ++ } else if p.Type == "int32" { ++ argscommon = append(argscommon, p.Name) ++ argscall = append(argscall, fmt.Sprintf("%s int32", p.Name)) ++ argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) ++ } else if p.Type == "int64" { ++ argscommon = append(argscommon, p.Name) ++ argscall = append(argscall, fmt.Sprintf("%s int64", p.Name)) ++ argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.longlong(%s)", p.Name)) ++ } else if p.Type == "uint32" { ++ argscommon = append(argscommon, p.Name) ++ argscall = append(argscall, fmt.Sprintf("%s uint32", p.Name)) ++ argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uint(%s)", p.Name)) ++ } else if p.Type == "uint64" { ++ argscommon = append(argscommon, p.Name) ++ argscall = append(argscall, fmt.Sprintf("%s uint64", p.Name)) ++ argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.ulonglong(%s)", p.Name)) ++ } else if p.Type == "uintptr" { ++ argscommon = append(argscommon, p.Name) ++ argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name)) ++ argsgc = append(argsgc, p.Name) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name)) ++ } else { ++ argscommon = append(argscommon, fmt.Sprintf("int(%s)", p.Name)) ++ argscall = append(argscall, fmt.Sprintf("%s int", p.Name)) ++ argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name)) ++ argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name)) ++ } ++ argN++ ++ } ++ nargs := len(argsgc) ++ ++ // COMMON function generation ++ argscommonlist := strings.Join(argscommon, ", ") ++ callcommon := fmt.Sprintf("call%s(%s)", sysname, argscommonlist) ++ ret := []string{"_", "_"} ++ body := "" ++ doErrno := false ++ for i := 0; i < len(out); i++ { ++ p := parseParam(out[i]) ++ reg := "" ++ if p.Name == "err" { ++ reg = "e1" ++ ret[1] = reg ++ doErrno = true ++ } else { ++ reg = "r0" ++ ret[0] = reg ++ } ++ if p.Type == "bool" { ++ reg = fmt.Sprintf("%s != 0", reg) ++ } ++ if reg != "e1" { ++ body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) ++ } ++ } ++ if ret[0] == "_" && ret[1] == "_" { ++ textcommon += fmt.Sprintf("\t%s\n", callcommon) ++ } else { ++ textcommon += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], callcommon) ++ } ++ textcommon += body ++ ++ if doErrno { ++ textcommon += "\tif e1 != 0 {\n" ++ textcommon += "\t\terr = errnoErr(e1)\n" ++ textcommon += "\t}\n" ++ } ++ textcommon += "\treturn\n" ++ textcommon += "}\n" ++ ++ if onlyCommon { ++ continue ++ } ++ ++ // CALL Prototype ++ callProto := fmt.Sprintf("func call%s(%s) (r1 uintptr, e1 Errno) {\n", sysname, strings.Join(argscall, ", ")) ++ ++ // GC function generation ++ asm := "syscall6" ++ if nonblock != nil { ++ asm = "rawSyscall6" ++ } ++ ++ if len(argsgc) <= 6 { ++ for len(argsgc) < 6 { ++ argsgc = append(argsgc, "0") ++ } ++ } else { ++ fmt.Fprintf(os.Stderr, "%s: too many arguments to system call", funct) ++ os.Exit(1) ++ } ++ argsgclist := strings.Join(argsgc, ", ") ++ callgc := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, argsgclist) ++ ++ textgc += callProto ++ textgc += fmt.Sprintf("\tr1, _, e1 = %s\n", callgc) ++ textgc += "\treturn\n}\n" ++ ++ // GCCGO function generation ++ argsgccgolist := strings.Join(argsgccgo, ", ") ++ var callgccgo string ++ if sysname == "select" { ++ // select is a keyword of Go. Its name is ++ // changed to c_select. ++ callgccgo = fmt.Sprintf("C.c_%s(%s)", sysname, argsgccgolist) ++ } else { ++ callgccgo = fmt.Sprintf("C.%s(%s)", sysname, argsgccgolist) ++ } ++ textgccgo += callProto ++ textgccgo += fmt.Sprintf("\tr1 = uintptr(%s)\n", callgccgo) ++ textgccgo += "\te1 = syscall.GetErrno()\n" ++ textgccgo += "\treturn\n}\n" ++ } ++ if err := s.Err(); err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ file.Close() ++ } ++ imp := "" ++ if pack != "unix" { ++ imp = "import \"golang.org/x/sys/unix\"\n" ++ ++ } ++ ++ // Print zsyscall_aix_ppc64.go ++ err := ioutil.WriteFile("zsyscall_aix_ppc64.go", ++ []byte(fmt.Sprintf(srcTemplate1, cmdLine(), buildTags(), pack, imp, textcommon)), ++ 0644) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ ++ // Print zsyscall_aix_ppc64_gc.go ++ vardecls := "\t" + strings.Join(vars, ",\n\t") ++ vardecls += " syscallFunc" ++ err = ioutil.WriteFile("zsyscall_aix_ppc64_gc.go", ++ []byte(fmt.Sprintf(srcTemplate2, cmdLine(), buildTags(), pack, imp, dynimports, linknames, vardecls, textgc)), ++ 0644) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ ++ // Print zsyscall_aix_ppc64_gccgo.go ++ err = ioutil.WriteFile("zsyscall_aix_ppc64_gccgo.go", ++ []byte(fmt.Sprintf(srcTemplate3, cmdLine(), buildTags(), pack, cExtern, imp, textgccgo)), ++ 0644) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++} ++ ++const srcTemplate1 = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++ ++package %s ++ ++import ( ++ "unsafe" ++) ++ ++ ++%s ++ ++%s ++` ++const srcTemplate2 = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++// +build !gccgo ++ ++package %s ++ ++import ( ++ "unsafe" ++) ++%s ++%s ++%s ++type syscallFunc uintptr ++ ++var ( ++%s ++) ++ ++// Implemented in runtime/syscall_aix.go. ++func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) ++func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) ++ ++%s ++` ++const srcTemplate3 = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++// +build gccgo ++ ++package %s ++ ++%s ++*/ ++import "C" ++import ( ++ "syscall" ++) ++ ++ ++%s ++ ++%s ++` +diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go +new file mode 100644 +index 00000000..675597e4 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go +@@ -0,0 +1,341 @@ ++// 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. ++ ++// +build ignore ++ ++/* ++ This program reads a file containing function prototypes ++ (like syscall_solaris.go) and generates system call bodies. ++ The prototypes are marked by lines beginning with "//sys" ++ and read like func declarations if //sys is replaced by func, but: ++ * The parameter lists must give a name for each argument. ++ This includes return parameters. ++ * The parameter lists must give a type for each argument: ++ the (x, y, z int) shorthand is not allowed. ++ * If the return parameter is an error number, it must be named err. ++ * If go func name needs to be different than its libc name, ++ * or the function is not in libc, name could be specified ++ * at the end, after "=" sign, like ++ //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt ++*/ ++ ++package main ++ ++import ( ++ "bufio" ++ "flag" ++ "fmt" ++ "os" ++ "regexp" ++ "strings" ++) ++ ++var ( ++ b32 = flag.Bool("b32", false, "32bit big-endian") ++ l32 = flag.Bool("l32", false, "32bit little-endian") ++ tags = flag.String("tags", "", "build tags") ++ illumos = flag.Bool("illumos", false, "illumos specific code generation") ++) ++ ++// cmdLine returns this programs's commandline arguments ++func cmdLine() string { ++ return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ") ++} ++ ++// buildTags returns build tags ++func buildTags() string { ++ return *tags ++} ++ ++// Param is function parameter ++type Param struct { ++ Name string ++ Type string ++} ++ ++// usage prints the program usage ++func usage() { ++ fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n") ++ os.Exit(1) ++} ++ ++// parseParamList parses parameter list and returns a slice of parameters ++func parseParamList(list string) []string { ++ list = strings.TrimSpace(list) ++ if list == "" { ++ return []string{} ++ } ++ return regexp.MustCompile(`\s*,\s*`).Split(list, -1) ++} ++ ++// parseParam splits a parameter into name and type ++func parseParam(p string) Param { ++ ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p) ++ if ps == nil { ++ fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p) ++ os.Exit(1) ++ } ++ return Param{ps[1], ps[2]} ++} ++ ++func main() { ++ flag.Usage = usage ++ flag.Parse() ++ if len(flag.Args()) <= 0 { ++ fmt.Fprintf(os.Stderr, "no files to parse provided\n") ++ usage() ++ } ++ ++ endianness := "" ++ if *b32 { ++ endianness = "big-endian" ++ } else if *l32 { ++ endianness = "little-endian" ++ } ++ ++ pack := "" ++ text := "" ++ dynimports := "" ++ linknames := "" ++ var vars []string ++ for _, path := range flag.Args() { ++ file, err := os.Open(path) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ s := bufio.NewScanner(file) ++ for s.Scan() { ++ t := s.Text() ++ t = strings.TrimSpace(t) ++ t = regexp.MustCompile(`\s+`).ReplaceAllString(t, ` `) ++ if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" { ++ pack = p[1] ++ } ++ nonblock := regexp.MustCompile(`^\/\/sysnb `).FindStringSubmatch(t) ++ if regexp.MustCompile(`^\/\/sys `).FindStringSubmatch(t) == nil && nonblock == nil { ++ continue ++ } ++ ++ // Line must be of the form ++ // func Open(path string, mode int, perm int) (fd int, err error) ++ // Split into name, in params, out params. ++ f := regexp.MustCompile(`^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t) ++ if f == nil { ++ fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t) ++ os.Exit(1) ++ } ++ funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6] ++ ++ // Split argument lists on comma. ++ in := parseParamList(inps) ++ out := parseParamList(outps) ++ ++ inps = strings.Join(in, ", ") ++ outps = strings.Join(out, ", ") ++ ++ // Try in vain to keep people from editing this file. ++ // The theory is that they jump into the middle of the file ++ // without reading the header. ++ text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n" ++ ++ // So file name. ++ if modname == "" { ++ modname = "libc" ++ } ++ ++ // System call name. ++ if sysname == "" { ++ sysname = funct ++ } ++ ++ // System call pointer variable name. ++ sysvarname := fmt.Sprintf("proc%s", sysname) ++ ++ strconvfunc := "BytePtrFromString" ++ strconvtype := "*byte" ++ ++ sysname = strings.ToLower(sysname) // All libc functions are lowercase. ++ ++ // Runtime import of function to allow cross-platform builds. ++ dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname) ++ // Link symbol to proc address variable. ++ linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname) ++ // Library proc address variable. ++ vars = append(vars, sysvarname) ++ ++ // Go function header. ++ outlist := strings.Join(out, ", ") ++ if outlist != "" { ++ outlist = fmt.Sprintf(" (%s)", outlist) ++ } ++ if text != "" { ++ text += "\n" ++ } ++ text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist) ++ ++ // Check if err return available ++ errvar := "" ++ for _, param := range out { ++ p := parseParam(param) ++ if p.Type == "error" { ++ errvar = p.Name ++ continue ++ } ++ } ++ ++ // Prepare arguments to Syscall. ++ var args []string ++ n := 0 ++ for _, param := range in { ++ p := parseParam(param) ++ if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil { ++ args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))") ++ } else if p.Type == "string" && errvar != "" { ++ text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) ++ text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name) ++ text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar) ++ args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) ++ n++ ++ } else if p.Type == "string" { ++ fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n") ++ text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype) ++ text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name) ++ args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n)) ++ n++ ++ } else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil { ++ // Convert slice into pointer, length. ++ // Have to be careful not to take address of &a[0] if len == 0: ++ // pass nil in that case. ++ text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1]) ++ text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name) ++ args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name)) ++ n++ ++ } else if p.Type == "int64" && endianness != "" { ++ if endianness == "big-endian" { ++ args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name)) ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name)) ++ } ++ } else if p.Type == "bool" { ++ text += fmt.Sprintf("\tvar _p%d uint32\n", n) ++ text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n) ++ args = append(args, fmt.Sprintf("uintptr(_p%d)", n)) ++ n++ ++ } else { ++ args = append(args, fmt.Sprintf("uintptr(%s)", p.Name)) ++ } ++ } ++ nargs := len(args) ++ ++ // Determine which form to use; pad args with zeros. ++ asm := "sysvicall6" ++ if nonblock != nil { ++ asm = "rawSysvicall6" ++ } ++ if len(args) <= 6 { ++ for len(args) < 6 { ++ args = append(args, "0") ++ } ++ } else { ++ fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path) ++ os.Exit(1) ++ } ++ ++ // Actual call. ++ arglist := strings.Join(args, ", ") ++ call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist) ++ ++ // Assign return values. ++ body := "" ++ ret := []string{"_", "_", "_"} ++ doErrno := false ++ for i := 0; i < len(out); i++ { ++ p := parseParam(out[i]) ++ reg := "" ++ if p.Name == "err" { ++ reg = "e1" ++ ret[2] = reg ++ doErrno = true ++ } else { ++ reg = fmt.Sprintf("r%d", i) ++ ret[i] = reg ++ } ++ if p.Type == "bool" { ++ reg = fmt.Sprintf("%d != 0", reg) ++ } ++ if p.Type == "int64" && endianness != "" { ++ // 64-bit number in r1:r0 or r0:r1. ++ if i+2 > len(out) { ++ fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path) ++ os.Exit(1) ++ } ++ if endianness == "big-endian" { ++ reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1) ++ } else { ++ reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i) ++ } ++ ret[i] = fmt.Sprintf("r%d", i) ++ ret[i+1] = fmt.Sprintf("r%d", i+1) ++ } ++ if reg != "e1" { ++ body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg) ++ } ++ } ++ if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" { ++ text += fmt.Sprintf("\t%s\n", call) ++ } else { ++ text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call) ++ } ++ text += body ++ ++ if doErrno { ++ text += "\tif e1 != 0 {\n" ++ text += "\t\terr = e1\n" ++ text += "\t}\n" ++ } ++ text += "\treturn\n" ++ text += "}\n" ++ } ++ if err := s.Err(); err != nil { ++ fmt.Fprintf(os.Stderr, err.Error()) ++ os.Exit(1) ++ } ++ file.Close() ++ } ++ imp := "" ++ if pack != "unix" { ++ imp = "import \"golang.org/x/sys/unix\"\n" ++ } ++ ++ syscallimp := "" ++ if !*illumos { ++ syscallimp = "\"syscall\"" ++ } ++ ++ vardecls := "\t" + strings.Join(vars, ",\n\t") ++ vardecls += " syscallFunc" ++ fmt.Printf(srcTemplate, cmdLine(), buildTags(), pack, syscallimp, imp, dynimports, linknames, vardecls, text) ++} ++ ++const srcTemplate = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++ ++package %s ++ ++import ( ++ "unsafe" ++ %s ++) ++%s ++%s ++%s ++var ( ++%s ++) ++ ++%s ++` +diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go +new file mode 100644 +index 00000000..b6b40990 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go +@@ -0,0 +1,355 @@ ++// 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. ++ ++// +build ignore ++ ++// Parse the header files for OpenBSD and generate a Go usable sysctl MIB. ++// ++// Build a MIB with each entry being an array containing the level, type and ++// a hash that will contain additional entries if the current entry is a node. ++// We then walk this MIB and create a flattened sysctl name to OID hash. ++ ++package main ++ ++import ( ++ "bufio" ++ "fmt" ++ "os" ++ "path/filepath" ++ "regexp" ++ "sort" ++ "strings" ++) ++ ++var ( ++ goos, goarch string ++) ++ ++// cmdLine returns this programs's commandline arguments. ++func cmdLine() string { ++ return "go run mksysctl_openbsd.go " + strings.Join(os.Args[1:], " ") ++} ++ ++// buildTags returns build tags. ++func buildTags() string { ++ return fmt.Sprintf("%s,%s", goarch, goos) ++} ++ ++// reMatch performs regular expression match and stores the substring slice to value pointed by m. ++func reMatch(re *regexp.Regexp, str string, m *[]string) bool { ++ *m = re.FindStringSubmatch(str) ++ if *m != nil { ++ return true ++ } ++ return false ++} ++ ++type nodeElement struct { ++ n int ++ t string ++ pE *map[string]nodeElement ++} ++ ++var ( ++ debugEnabled bool ++ mib map[string]nodeElement ++ node *map[string]nodeElement ++ nodeMap map[string]string ++ sysCtl []string ++) ++ ++var ( ++ ctlNames1RE = regexp.MustCompile(`^#define\s+(CTL_NAMES)\s+{`) ++ ctlNames2RE = regexp.MustCompile(`^#define\s+(CTL_(.*)_NAMES)\s+{`) ++ ctlNames3RE = regexp.MustCompile(`^#define\s+((.*)CTL_NAMES)\s+{`) ++ netInetRE = regexp.MustCompile(`^netinet/`) ++ netInet6RE = regexp.MustCompile(`^netinet6/`) ++ netRE = regexp.MustCompile(`^net/`) ++ bracesRE = regexp.MustCompile(`{.*}`) ++ ctlTypeRE = regexp.MustCompile(`{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}`) ++ fsNetKernRE = regexp.MustCompile(`^(fs|net|kern)_`) ++) ++ ++func debug(s string) { ++ if debugEnabled { ++ fmt.Fprintln(os.Stderr, s) ++ } ++} ++ ++// Walk the MIB and build a sysctl name to OID mapping. ++func buildSysctl(pNode *map[string]nodeElement, name string, oid []int) { ++ lNode := pNode // local copy of pointer to node ++ var keys []string ++ for k := range *lNode { ++ keys = append(keys, k) ++ } ++ sort.Strings(keys) ++ ++ for _, key := range keys { ++ nodename := name ++ if name != "" { ++ nodename += "." ++ } ++ nodename += key ++ ++ nodeoid := append(oid, (*pNode)[key].n) ++ ++ if (*pNode)[key].t == `CTLTYPE_NODE` { ++ if _, ok := nodeMap[nodename]; ok { ++ lNode = &mib ++ ctlName := nodeMap[nodename] ++ for _, part := range strings.Split(ctlName, ".") { ++ lNode = ((*lNode)[part]).pE ++ } ++ } else { ++ lNode = (*pNode)[key].pE ++ } ++ buildSysctl(lNode, nodename, nodeoid) ++ } else if (*pNode)[key].t != "" { ++ oidStr := []string{} ++ for j := range nodeoid { ++ oidStr = append(oidStr, fmt.Sprintf("%d", nodeoid[j])) ++ } ++ text := "\t{ \"" + nodename + "\", []_C_int{ " + strings.Join(oidStr, ", ") + " } }, \n" ++ sysCtl = append(sysCtl, text) ++ } ++ } ++} ++ ++func main() { ++ // Get the OS (using GOOS_TARGET if it exist) ++ goos = os.Getenv("GOOS_TARGET") ++ if goos == "" { ++ goos = os.Getenv("GOOS") ++ } ++ // Get the architecture (using GOARCH_TARGET if it exists) ++ goarch = os.Getenv("GOARCH_TARGET") ++ if goarch == "" { ++ goarch = os.Getenv("GOARCH") ++ } ++ // Check if GOOS and GOARCH environment variables are defined ++ if goarch == "" || goos == "" { ++ fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") ++ os.Exit(1) ++ } ++ ++ mib = make(map[string]nodeElement) ++ headers := [...]string{ ++ `sys/sysctl.h`, ++ `sys/socket.h`, ++ `sys/tty.h`, ++ `sys/malloc.h`, ++ `sys/mount.h`, ++ `sys/namei.h`, ++ `sys/sem.h`, ++ `sys/shm.h`, ++ `sys/vmmeter.h`, ++ `uvm/uvmexp.h`, ++ `uvm/uvm_param.h`, ++ `uvm/uvm_swap_encrypt.h`, ++ `ddb/db_var.h`, ++ `net/if.h`, ++ `net/if_pfsync.h`, ++ `net/pipex.h`, ++ `netinet/in.h`, ++ `netinet/icmp_var.h`, ++ `netinet/igmp_var.h`, ++ `netinet/ip_ah.h`, ++ `netinet/ip_carp.h`, ++ `netinet/ip_divert.h`, ++ `netinet/ip_esp.h`, ++ `netinet/ip_ether.h`, ++ `netinet/ip_gre.h`, ++ `netinet/ip_ipcomp.h`, ++ `netinet/ip_ipip.h`, ++ `netinet/pim_var.h`, ++ `netinet/tcp_var.h`, ++ `netinet/udp_var.h`, ++ `netinet6/in6.h`, ++ `netinet6/ip6_divert.h`, ++ `netinet6/pim6_var.h`, ++ `netinet/icmp6.h`, ++ `netmpls/mpls.h`, ++ } ++ ++ ctls := [...]string{ ++ `kern`, ++ `vm`, ++ `fs`, ++ `net`, ++ //debug /* Special handling required */ ++ `hw`, ++ //machdep /* Arch specific */ ++ `user`, ++ `ddb`, ++ //vfs /* Special handling required */ ++ `fs.posix`, ++ `kern.forkstat`, ++ `kern.intrcnt`, ++ `kern.malloc`, ++ `kern.nchstats`, ++ `kern.seminfo`, ++ `kern.shminfo`, ++ `kern.timecounter`, ++ `kern.tty`, ++ `kern.watchdog`, ++ `net.bpf`, ++ `net.ifq`, ++ `net.inet`, ++ `net.inet.ah`, ++ `net.inet.carp`, ++ `net.inet.divert`, ++ `net.inet.esp`, ++ `net.inet.etherip`, ++ `net.inet.gre`, ++ `net.inet.icmp`, ++ `net.inet.igmp`, ++ `net.inet.ip`, ++ `net.inet.ip.ifq`, ++ `net.inet.ipcomp`, ++ `net.inet.ipip`, ++ `net.inet.mobileip`, ++ `net.inet.pfsync`, ++ `net.inet.pim`, ++ `net.inet.tcp`, ++ `net.inet.udp`, ++ `net.inet6`, ++ `net.inet6.divert`, ++ `net.inet6.ip6`, ++ `net.inet6.icmp6`, ++ `net.inet6.pim6`, ++ `net.inet6.tcp6`, ++ `net.inet6.udp6`, ++ `net.mpls`, ++ `net.mpls.ifq`, ++ `net.key`, ++ `net.pflow`, ++ `net.pfsync`, ++ `net.pipex`, ++ `net.rt`, ++ `vm.swapencrypt`, ++ //vfsgenctl /* Special handling required */ ++ } ++ ++ // Node name "fixups" ++ ctlMap := map[string]string{ ++ "ipproto": "net.inet", ++ "net.inet.ipproto": "net.inet", ++ "net.inet6.ipv6proto": "net.inet6", ++ "net.inet6.ipv6": "net.inet6.ip6", ++ "net.inet.icmpv6": "net.inet6.icmp6", ++ "net.inet6.divert6": "net.inet6.divert", ++ "net.inet6.tcp6": "net.inet.tcp", ++ "net.inet6.udp6": "net.inet.udp", ++ "mpls": "net.mpls", ++ "swpenc": "vm.swapencrypt", ++ } ++ ++ // Node mappings ++ nodeMap = map[string]string{ ++ "net.inet.ip.ifq": "net.ifq", ++ "net.inet.pfsync": "net.pfsync", ++ "net.mpls.ifq": "net.ifq", ++ } ++ ++ mCtls := make(map[string]bool) ++ for _, ctl := range ctls { ++ mCtls[ctl] = true ++ } ++ ++ for _, header := range headers { ++ debug("Processing " + header) ++ file, err := os.Open(filepath.Join("/usr/include", header)) ++ if err != nil { ++ fmt.Fprintf(os.Stderr, "%v\n", err) ++ os.Exit(1) ++ } ++ s := bufio.NewScanner(file) ++ for s.Scan() { ++ var sub []string ++ if reMatch(ctlNames1RE, s.Text(), &sub) || ++ reMatch(ctlNames2RE, s.Text(), &sub) || ++ reMatch(ctlNames3RE, s.Text(), &sub) { ++ if sub[1] == `CTL_NAMES` { ++ // Top level. ++ node = &mib ++ } else { ++ // Node. ++ nodename := strings.ToLower(sub[2]) ++ ctlName := "" ++ if reMatch(netInetRE, header, &sub) { ++ ctlName = "net.inet." + nodename ++ } else if reMatch(netInet6RE, header, &sub) { ++ ctlName = "net.inet6." + nodename ++ } else if reMatch(netRE, header, &sub) { ++ ctlName = "net." + nodename ++ } else { ++ ctlName = nodename ++ ctlName = fsNetKernRE.ReplaceAllString(ctlName, `$1.`) ++ } ++ ++ if val, ok := ctlMap[ctlName]; ok { ++ ctlName = val ++ } ++ if _, ok := mCtls[ctlName]; !ok { ++ debug("Ignoring " + ctlName + "...") ++ continue ++ } ++ ++ // Walk down from the top of the MIB. ++ node = &mib ++ for _, part := range strings.Split(ctlName, ".") { ++ if _, ok := (*node)[part]; !ok { ++ debug("Missing node " + part) ++ (*node)[part] = nodeElement{n: 0, t: "", pE: &map[string]nodeElement{}} ++ } ++ node = (*node)[part].pE ++ } ++ } ++ ++ // Populate current node with entries. ++ i := -1 ++ for !strings.HasPrefix(s.Text(), "}") { ++ s.Scan() ++ if reMatch(bracesRE, s.Text(), &sub) { ++ i++ ++ } ++ if !reMatch(ctlTypeRE, s.Text(), &sub) { ++ continue ++ } ++ (*node)[sub[1]] = nodeElement{n: i, t: sub[2], pE: &map[string]nodeElement{}} ++ } ++ } ++ } ++ err = s.Err() ++ if err != nil { ++ fmt.Fprintf(os.Stderr, "%v\n", err) ++ os.Exit(1) ++ } ++ file.Close() ++ } ++ buildSysctl(&mib, "", []int{}) ++ ++ sort.Strings(sysCtl) ++ text := strings.Join(sysCtl, "") ++ ++ fmt.Printf(srcTemplate, cmdLine(), buildTags(), text) ++} ++ ++const srcTemplate = `// %s ++// Code generated by the command above; DO NOT EDIT. ++ ++// +build %s ++ ++package unix ++ ++type mibentry struct { ++ ctlname string ++ ctloid []_C_int ++} ++ ++var sysctlMib = []mibentry { ++%s ++} ++` +diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go +new file mode 100644 +index 00000000..baa6ecd8 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/mksysnum.go +@@ -0,0 +1,190 @@ ++// Copyright 2018 The Go 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 ++ ++// Generate system call table for DragonFly, NetBSD, ++// FreeBSD, OpenBSD or Darwin from master list ++// (for example, /usr/src/sys/kern/syscalls.master or ++// sys/syscall.h). ++package main ++ ++import ( ++ "bufio" ++ "fmt" ++ "io" ++ "io/ioutil" ++ "net/http" ++ "os" ++ "regexp" ++ "strings" ++) ++ ++var ( ++ goos, goarch string ++) ++ ++// cmdLine returns this programs's commandline arguments ++func cmdLine() string { ++ return "go run mksysnum.go " + strings.Join(os.Args[1:], " ") ++} ++ ++// buildTags returns build tags ++func buildTags() string { ++ return fmt.Sprintf("%s,%s", goarch, goos) ++} ++ ++func checkErr(err error) { ++ if err != nil { ++ fmt.Fprintf(os.Stderr, "%v\n", err) ++ os.Exit(1) ++ } ++} ++ ++// source string and substring slice for regexp ++type re struct { ++ str string // source string ++ sub []string // matched sub-string ++} ++ ++// Match performs regular expression match ++func (r *re) Match(exp string) bool { ++ r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str) ++ if r.sub != nil { ++ return true ++ } ++ return false ++} ++ ++// fetchFile fetches a text file from URL ++func fetchFile(URL string) io.Reader { ++ resp, err := http.Get(URL) ++ checkErr(err) ++ defer resp.Body.Close() ++ body, err := ioutil.ReadAll(resp.Body) ++ checkErr(err) ++ return strings.NewReader(string(body)) ++} ++ ++// readFile reads a text file from path ++func readFile(path string) io.Reader { ++ file, err := os.Open(os.Args[1]) ++ checkErr(err) ++ return file ++} ++ ++func format(name, num, proto string) string { ++ name = strings.ToUpper(name) ++ // There are multiple entries for enosys and nosys, so comment them out. ++ nm := re{str: name} ++ if nm.Match(`^SYS_E?NOSYS$`) { ++ name = fmt.Sprintf("// %s", name) ++ } ++ if name == `SYS_SYS_EXIT` { ++ name = `SYS_EXIT` ++ } ++ return fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) ++} ++ ++func main() { ++ // Get the OS (using GOOS_TARGET if it exist) ++ goos = os.Getenv("GOOS_TARGET") ++ if goos == "" { ++ goos = os.Getenv("GOOS") ++ } ++ // Get the architecture (using GOARCH_TARGET if it exists) ++ goarch = os.Getenv("GOARCH_TARGET") ++ if goarch == "" { ++ goarch = os.Getenv("GOARCH") ++ } ++ // Check if GOOS and GOARCH environment variables are defined ++ if goarch == "" || goos == "" { ++ fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n") ++ os.Exit(1) ++ } ++ ++ file := strings.TrimSpace(os.Args[1]) ++ var syscalls io.Reader ++ if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") { ++ // Download syscalls.master file ++ syscalls = fetchFile(file) ++ } else { ++ syscalls = readFile(file) ++ } ++ ++ var text, line string ++ s := bufio.NewScanner(syscalls) ++ for s.Scan() { ++ t := re{str: line} ++ if t.Match(`^(.*)\\$`) { ++ // Handle continuation ++ line = t.sub[1] ++ line += strings.TrimLeft(s.Text(), " \t") ++ } else { ++ // New line ++ line = s.Text() ++ } ++ t = re{str: line} ++ if t.Match(`\\$`) { ++ continue ++ } ++ t = re{str: line} ++ ++ switch goos { ++ case "dragonfly": ++ if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) { ++ num, proto := t.sub[1], t.sub[2] ++ name := fmt.Sprintf("SYS_%s", t.sub[3]) ++ text += format(name, num, proto) ++ } ++ case "freebsd": ++ if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) { ++ num, proto := t.sub[1], t.sub[2] ++ name := fmt.Sprintf("SYS_%s", t.sub[3]) ++ text += format(name, num, proto) ++ } ++ case "openbsd": ++ if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) { ++ num, proto, name := t.sub[1], t.sub[3], t.sub[4] ++ text += format(name, num, proto) ++ } ++ case "netbsd": ++ if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) { ++ num, proto, compat := t.sub[1], t.sub[6], t.sub[8] ++ name := t.sub[7] + "_" + t.sub[9] ++ if t.sub[11] != "" { ++ name = t.sub[7] + "_" + t.sub[11] ++ } ++ name = strings.ToUpper(name) ++ if compat == "" || compat == "13" || compat == "30" || compat == "50" { ++ text += fmt.Sprintf(" %s = %s; // %s\n", name, num, proto) ++ } ++ } ++ case "darwin": ++ if t.Match(`^#define\s+SYS_(\w+)\s+([0-9]+)`) { ++ name, num := t.sub[1], t.sub[2] ++ name = strings.ToUpper(name) ++ text += fmt.Sprintf(" SYS_%s = %s;\n", name, num) ++ } ++ default: ++ fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos) ++ os.Exit(1) ++ ++ } ++ } ++ err := s.Err() ++ checkErr(err) ++ ++ fmt.Printf(template, cmdLine(), buildTags(), text) ++} ++ ++const template = `// %s ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build %s ++ ++package unix ++ ++const( ++%s)` +diff --git a/vendor/golang.org/x/sys/unix/openbsd_pledge.go b/vendor/golang.org/x/sys/unix/openbsd_pledge.go +deleted file mode 100644 +index db4f72ea..00000000 +--- a/vendor/golang.org/x/sys/unix/openbsd_pledge.go ++++ /dev/null +@@ -1,38 +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 openbsd +-// +build 386 amd64 arm +- +-package unix +- +-import ( +- "syscall" +- "unsafe" +-) +- +-const ( +- SYS_PLEDGE = 108 +-) +- +-// Pledge implements the pledge syscall. For more information see pledge(2). +-func Pledge(promises string, paths []string) error { +- promisesPtr, err := syscall.BytePtrFromString(promises) +- 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 { +- return err +- } +- pathsUnsafe = unsafe.Pointer(&pathsPtr[0]) +- } +- _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0) +- if e != 0 { +- return e +- } +- return nil +-} +diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/vendor/golang.org/x/sys/unix/pagesize_unix.go +new file mode 100644 +index 00000000..bc2f3629 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/pagesize_unix.go +@@ -0,0 +1,15 @@ ++// 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris ++ ++// For Unix, get the pagesize from the runtime. ++ ++package unix ++ ++import "syscall" ++ ++func Getpagesize() int { ++ return syscall.Getpagesize() ++} +diff --git a/vendor/golang.org/x/sys/unix/pledge_openbsd.go b/vendor/golang.org/x/sys/unix/pledge_openbsd.go +new file mode 100644 +index 00000000..eb48294b +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/pledge_openbsd.go +@@ -0,0 +1,163 @@ ++// 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 unix ++ ++import ( ++ "errors" ++ "fmt" ++ "strconv" ++ "syscall" ++ "unsafe" ++) ++ ++// 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 ++ } ++ ++ err = pledgeAvailable(maj, min, execpromises) ++ if err != nil { ++ return err ++ } ++ ++ 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 ++ } ++ 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 ++ } ++ ++ // This variable holds the promises and is always nil. ++ var pptr unsafe.Pointer ++ ++ exptr, err := syscall.BytePtrFromString(execpromises) ++ if err != nil { ++ return err ++ } ++ ++ _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr), uintptr(unsafe.Pointer(exptr)), 0) ++ if e != 0 { ++ return e ++ } ++ ++ return nil ++} ++ ++// majmin returns major and minor version number for an OpenBSD system. ++func majmin() (major int, minor int, err error) { ++ var v Utsname ++ err = Uname(&v) ++ if err != nil { ++ return ++ } ++ ++ major, err = strconv.Atoi(string(v.Release[0])) ++ if err != nil { ++ err = errors.New("cannot parse major version number returned by uname") ++ return ++ } ++ ++ minor, err = strconv.Atoi(string(v.Release[2])) ++ if err != nil { ++ err = errors.New("cannot parse minor version number returned by uname") ++ return ++ } ++ ++ return ++} ++ ++// pledgeAvailable checks for availability of the pledge(2) syscall ++// based on the running OpenBSD version. ++func pledgeAvailable(maj, min int, execpromises string) error { ++ // If OpenBSD <= 5.9, pledge is not available. ++ if (maj == 5 && min != 9) || maj < 5 { ++ return fmt.Errorf("pledge syscall is not available on OpenBSD %d.%d", maj, min) ++ } ++ ++ // If OpenBSD <= 6.2 and execpromises is not empty, ++ // return an error - execpromises is not available before 6.3 ++ if (maj < 6 || (maj == 6 && min <= 2)) && execpromises != "" { ++ return fmt.Errorf("cannot use execpromises on OpenBSD %d.%d", maj, min) ++ } ++ ++ return nil ++} +diff --git a/vendor/golang.org/x/sys/unix/race.go b/vendor/golang.org/x/sys/unix/race.go +index 3c7627eb..61712b51 100644 +--- a/vendor/golang.org/x/sys/unix/race.go ++++ b/vendor/golang.org/x/sys/unix/race.go +@@ -1,4 +1,4 @@ +-// Copyright 2012 The Go Authors. All rights reserved. ++// 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. + +diff --git a/vendor/golang.org/x/sys/unix/race0.go b/vendor/golang.org/x/sys/unix/race0.go +index f8678e0d..ad026678 100644 +--- a/vendor/golang.org/x/sys/unix/race0.go ++++ b/vendor/golang.org/x/sys/unix/race0.go +@@ -1,8 +1,8 @@ +-// Copyright 2012 The Go Authors. All rights reserved. ++// 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. + +-// +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/vendor/golang.org/x/sys/unix/readdirent_getdents.go b/vendor/golang.org/x/sys/unix/readdirent_getdents.go +new file mode 100644 +index 00000000..3a90aa6d +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/readdirent_getdents.go +@@ -0,0 +1,12 @@ ++// 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. ++ ++// +build aix dragonfly freebsd linux netbsd openbsd ++ ++package unix ++ ++// ReadDirent reads directory entries from fd and writes them into buf. ++func ReadDirent(fd int, buf []byte) (n int, err error) { ++ return Getdents(fd, buf) ++} +diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +new file mode 100644 +index 00000000..5fdae40b +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +@@ -0,0 +1,19 @@ ++// 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. ++ ++// +build darwin ++ ++package unix ++ ++import "unsafe" ++ ++// ReadDirent reads directory entries from fd and writes them into buf. ++func ReadDirent(fd int, buf []byte) (n int, err error) { ++ // Final argument is (basep *uintptr) and the syscall doesn't take nil. ++ // 64 bits should be enough. (32 bits isn't even on 386). Since the ++ // actual system call is getdirentries64, 64 is a good guess. ++ // TODO(rsc): Can we use a single global basep for all calls? ++ var base = (*uintptr)(unsafe.Pointer(new(uint64))) ++ return Getdirentries(fd, buf, base) ++} +diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go b/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go +new file mode 100644 +index 00000000..5144deec +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go +@@ -0,0 +1,16 @@ ++// 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 ++ ++// Round the length of a raw sockaddr up to align it properly. ++func cmsgAlignOf(salen int) int { ++ salign := SizeofPtr ++ if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { ++ // 64-bit Dragonfly before the September 2019 ABI changes still requires ++ // 32-bit aligned access to network subsystem. ++ salign = 4 ++ } ++ return (salen + salign - 1) & ^(salign - 1) ++} +diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go +index d9ff4731..8bf45705 100644 +--- a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go ++++ b/vendor/golang.org/x/sys/unix/sockcmsg_linux.go +@@ -1,4 +1,4 @@ +-// Copyright 2011 The Go Authors. All rights reserved. ++// Copyright 2011 The Go Authors. All rights reserved. + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + +@@ -17,7 +17,7 @@ func UnixCredentials(ucred *Ucred) []byte { + h.Level = SOL_SOCKET + h.Type = SCM_CREDENTIALS + h.SetLen(CmsgLen(SizeofUcred)) +- *((*Ucred)(cmsgData(h))) = *ucred ++ *(*Ucred)(h.data(0)) = *ucred + return b + } + +diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +index bb756ece..003916ed 100644 +--- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go ++++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +@@ -2,25 +2,15 @@ + // 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" +- +-// Round the length of a raw sockaddr up to align it properly. +-func cmsgAlignOf(salen int) int { +- salign := sizeofPtr +- // NOTE: It seems like 64-bit Darwin, DragonFly BSD and +- // Solaris kernels still require 32-bit aligned access to +- // network subsystem. +- if darwin64Bit || dragonfly64Bit || solaris64Bit { +- salign = 4 +- } +- return (salen + salign - 1) & ^(salign - 1) +-} ++import ( ++ "unsafe" ++) + + // CmsgLen returns the value to store in the Len field of the Cmsghdr + // structure, taking into account any necessary alignment. +@@ -34,8 +24,8 @@ func CmsgSpace(datalen int) int { + return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen) + } + +-func cmsgData(h *Cmsghdr) unsafe.Pointer { +- return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr))) ++func (h *Cmsghdr) data(offset uintptr) unsafe.Pointer { ++ return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)) + offset) + } + + // SocketControlMessage represents a socket control message. +@@ -78,10 +68,8 @@ func UnixRights(fds ...int) []byte { + h.Level = SOL_SOCKET + h.Type = SCM_RIGHTS + h.SetLen(CmsgLen(datalen)) +- data := cmsgData(h) +- for _, fd := range fds { +- *(*int32)(data) = int32(fd) +- data = unsafe.Pointer(uintptr(data) + 4) ++ for i, fd := range fds { ++ *(*int32)(h.data(4 * uintptr(i))) = int32(fd) + } + return b + } +diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +new file mode 100644 +index 00000000..7d08dae5 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +@@ -0,0 +1,38 @@ ++// Copyright 2019 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build aix darwin freebsd linux netbsd openbsd solaris ++ ++package unix ++ ++import ( ++ "runtime" ++) ++ ++// Round the length of a raw sockaddr up to align it properly. ++func cmsgAlignOf(salen int) int { ++ salign := SizeofPtr ++ ++ // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in ++ // sockcmsg_dragonfly.go ++ switch runtime.GOOS { ++ case "aix": ++ // There is no alignment on AIX. ++ salign = 1 ++ case "darwin", "illumos", "solaris": ++ // NOTE: It seems like 64-bit Darwin, Illumos and Solaris ++ // kernels still require 32-bit aligned access to network ++ // subsystem. ++ if SizeofPtr == 8 { ++ salign = 4 ++ } ++ case "netbsd", "openbsd": ++ // NetBSD and OpenBSD armv7 require 64-bit alignment. ++ if runtime.GOARCH == "arm" { ++ salign = 8 ++ } ++ } ++ ++ return (salen + salign - 1) & ^(salign - 1) ++} +diff --git a/vendor/golang.org/x/sys/unix/str.go b/vendor/golang.org/x/sys/unix/str.go +index 35ed6643..17fb6986 100644 +--- a/vendor/golang.org/x/sys/unix/str.go ++++ b/vendor/golang.org/x/sys/unix/str.go +@@ -2,7 +2,7 @@ + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + +-// +build darwin dragonfly freebsd linux netbsd openbsd solaris ++// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + + package unix + +diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go +index 85e35020..fd4ee8eb 100644 +--- a/vendor/golang.org/x/sys/unix/syscall.go ++++ b/vendor/golang.org/x/sys/unix/syscall.go +@@ -2,33 +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 + + // Package unix contains an interface to the low-level operating system +-// primitives. OS details vary depending on the underlying system, and ++// primitives. OS details vary depending on the underlying system, and + // by default, godoc will display OS-specific documentation for the current +-// system. If you want godoc to display OS documentation for another +-// system, set $GOOS and $GOARCH to the desired system. For example, if ++// system. If you want godoc to display OS documentation for another ++// system, set $GOOS and $GOARCH to the desired system. For example, if + // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS + // to freebsd and $GOARCH to arm. ++// + // The primary use of this package is inside other packages that provide a more + // portable interface to the system, such as "os", "time" and "net". Use + // those packages rather than this one if you can. ++// + // For details of the functions and data types in this package consult + // the manuals for the appropriate operating system. ++// + // These calls return err == nil to indicate success; otherwise + // err represents an operating system error describing the failure and + // holds a value of type syscall.Errno. + package unix // import "golang.org/x/sys/unix" + ++import "strings" ++ + // ByteSliceFromString returns a NUL-terminated slice of bytes + // containing the text of s. If s contains a NUL byte at any + // location, it returns (nil, EINVAL). + func ByteSliceFromString(s string) ([]byte, error) { +- for i := 0; i < len(s); i++ { +- if s[i] == 0 { +- return nil, EINVAL +- } ++ if strings.IndexByte(s, 0) != -1 { ++ return nil, EINVAL + } + a := make([]byte, len(s)+1) + copy(a, s) +@@ -47,23 +50,4 @@ func BytePtrFromString(s string) (*byte, error) { + } + + // Single-word zero for use when we need a valid pointer to 0 bytes. +-// See mkunix.pl. + var _zero uintptr +- +-func (ts *Timespec) Unix() (sec int64, nsec int64) { +- return int64(ts.Sec), int64(ts.Nsec) +-} +- +-func (tv *Timeval) Unix() (sec int64, nsec int64) { +- return int64(tv.Sec), int64(tv.Usec) * 1000 +-} +- +-func (ts *Timespec) Nano() int64 { +- return int64(ts.Sec)*1e9 + int64(ts.Nsec) +-} +- +-func (tv *Timeval) Nano() int64 { +- return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 +-} +- +-func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } +diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go +new file mode 100644 +index 00000000..9ad8a0d4 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_aix.go +@@ -0,0 +1,536 @@ ++// Copyright 2018 The Go 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 // subtract 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 ++} ++ ++func direntIno(buf []byte) (uint64, bool) { ++ return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) ++} ++ ++func direntReclen(buf []byte) (uint64, bool) { ++ return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen)) ++} ++ ++func direntNamlen(buf []byte) (uint64, bool) { ++ reclen, ok := direntReclen(buf) ++ if !ok { ++ return 0, false ++ } ++ return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true ++} ++ ++//sys getdirent(fd int, buf []byte) (n int, err error) ++func Getdents(fd int, buf []byte) (n int, err error) { ++ return getdirent(fd, buf) ++} ++ ++//sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) ++func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { ++ var status _C_int ++ var r Pid_t ++ 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&0x80 == 0x80 } ++ ++func (w WaitStatus) TrapCause() int { return -1 } ++ ++//sys ioctl(fd int, req uint, arg uintptr) (err error) ++ ++// 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) ++//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 ++//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, statptr *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) ++ ++// In order to use msghdr structure with Control, Controllen, nrecvmsg and nsendmsg must be used. ++//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = nrecvmsg ++//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = nsendmsg ++ ++//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) ++ ++//sys Getsystemcfg(label int) (n uint64) ++ ++//sys umount(target string) (err error) ++func Unmount(target string, flags int) (err error) { ++ if flags != 0 { ++ // AIX doesn't have any flags for umount. ++ return ENOSYS ++ } ++ return umount(target) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go +new file mode 100644 +index 00000000..b3c8e330 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go +@@ -0,0 +1,54 @@ ++// Copyright 2018 The Go 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 (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ ++func (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) ++} ++ ++func Fstat(fd int, stat *Stat_t) error { ++ return fstat(fd, stat) ++} ++ ++func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { ++ return fstatat(dirfd, path, stat, flags) ++} ++ ++func Lstat(path string, stat *Stat_t) error { ++ return lstat(path, stat) ++} ++ ++func Stat(path string, statptr *Stat_t) error { ++ return stat(path, statptr) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +new file mode 100644 +index 00000000..9a6e0241 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +@@ -0,0 +1,85 @@ ++// Copyright 2018 The Go 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 (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ ++func (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) ++} ++ ++// In order to only have Timespec structure, type of Stat_t's fields ++// Atim, Mtim and Ctim is changed from StTimespec to Timespec during ++// ztypes generation. ++// On ppc64, Timespec.Nsec is an int64 while StTimespec.Nsec is an ++// int32, so the fields' value must be modified. ++func fixStatTimFields(stat *Stat_t) { ++ stat.Atim.Nsec >>= 32 ++ stat.Mtim.Nsec >>= 32 ++ stat.Ctim.Nsec >>= 32 ++} ++ ++func Fstat(fd int, stat *Stat_t) error { ++ err := fstat(fd, stat) ++ if err != nil { ++ return err ++ } ++ fixStatTimFields(stat) ++ return nil ++} ++ ++func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { ++ err := fstatat(dirfd, path, stat, flags) ++ if err != nil { ++ return err ++ } ++ fixStatTimFields(stat) ++ return nil ++} ++ ++func Lstat(path string, stat *Stat_t) error { ++ err := lstat(path, stat) ++ if err != nil { ++ return err ++ } ++ fixStatTimFields(stat) ++ return nil ++} ++ ++func Stat(path string, statptr *Stat_t) error { ++ err := stat(path, statptr) ++ if err != nil { ++ return err ++ } ++ fixStatTimFields(statptr) ++ return nil ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go +index c2846b32..68605db6 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_bsd.go ++++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go +@@ -34,7 +34,7 @@ func Getgroups() (gids []int, err error) { + return nil, nil + } + +- // Sanity check group count. Max is 16 on BSD. ++ // Sanity check group count. Max is 16 on BSD. + if n < 0 || n > 1000 { + return nil, EINVAL + } +@@ -63,15 +63,6 @@ func Setgroups(gids []int) (err error) { + return setgroups(len(a), &a[0]) + } + +-func ReadDirent(fd int, buf []byte) (n int, err error) { +- // Final argument is (basep *uintptr) and the syscall doesn't take nil. +- // 64 bits should be enough. (32 bits isn't even on 386). Since the +- // actual system call is getdirentries64, 64 is a good guess. +- // TODO(rsc): Can we use a single global basep for all calls? +- var base = (*uintptr)(unsafe.Pointer(new(uint64))) +- return Getdirentries(fd, buf, base) +-} +- + // Wait status is 7 bits at bottom, either 0 (exited), + // 0x7F (stopped), or a signal number that caused an exit. + // The 0x80 bit is whether there was a core dump. +@@ -86,6 +77,7 @@ const ( + shift = 8 + + exited = 0 ++ killed = 9 + stopped = 0x7F + ) + +@@ -112,6 +104,8 @@ func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 } + + func (w WaitStatus) Stopped() bool { return w&mask == stopped && syscall.Signal(w>>shift) != SIGSTOP } + ++func (w WaitStatus) Killed() bool { return w&mask == killed && syscall.Signal(w>>shift) != SIGKILL } ++ + func (w WaitStatus) Continued() bool { return w&mask == stopped && syscall.Signal(w>>shift) == SIGSTOP } + + func (w WaitStatus) StopSignal() syscall.Signal { +@@ -206,7 +200,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)) +@@ -243,7 +237,7 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { + break + } + } +- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] ++ bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] + sa.Name = string(bytes) + return sa, nil + +@@ -286,7 +280,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,50 +300,21 @@ 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) + +-func GetsockoptByte(fd, level, opt int) (value byte, err error) { +- var n byte +- vallen := _Socklen(1) +- err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) +- return n, err +-} +- +-func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) { +- vallen := _Socklen(4) +- err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) +- return value, err +-} +- +-func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) { +- var value IPMreq +- vallen := _Socklen(SizeofIPMreq) +- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) +- return &value, err +-} +- +-func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { +- var value IPv6Mreq +- vallen := _Socklen(SizeofIPv6Mreq) +- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) +- return &value, err +-} +- +-func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) { +- var value IPv6MTUInfo +- vallen := _Socklen(SizeofIPv6MTUInfo) +- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) +- return &value, err +-} +- +-func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) { +- var value ICMPv6Filter +- vallen := _Socklen(SizeofICMPv6Filter) +- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) +- return &value, err ++// GetsockoptString returns the string value of the socket option opt for the ++// socket associated with fd at the given socket level. ++func GetsockoptString(fd, level, opt int) (string, error) { ++ buf := make([]byte, 256) ++ vallen := _Socklen(len(buf)) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) ++ if err != nil { ++ return "", err ++ } ++ return string(buf[:vallen-1]), nil + } + + //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) +@@ -385,7 +350,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 + } +@@ -448,8 +413,6 @@ func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err e + return kevent(kq, change, len(changes), event, len(events), timeout) + } + +-//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL +- + // sysctlmib translates name to mib number and appends any additional args. + func sysctlmib(name string, args ...int) ([]_C_int, error) { + // Translate name to mib number. +@@ -547,6 +510,23 @@ func SysctlRaw(name string, args ...int) ([]byte, error) { + return buf[:n], 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 ++} ++ + //sys utimes(path string, timeval *[2]Timeval) (err error) + + func Utimes(path string, tv []Timeval) error { +@@ -570,7 +550,12 @@ func UtimesNano(path string, ts []Timespec) error { + if len(ts) != 2 { + return EINVAL + } +- err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) ++ // Darwin setattrlist can set nanosecond timestamps ++ err := setattrlistTimes(path, ts, 0) ++ if err != ENOSYS { ++ return err ++ } ++ err = utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) + if err != ENOSYS { + return err + } +@@ -590,6 +575,10 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { + if len(ts) != 2 { + return EINVAL + } ++ err := setattrlistTimes(path, ts, flags) ++ if err != ENOSYS { ++ return err ++ } + return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) + } + +@@ -605,7 +594,14 @@ func Futimes(fd int, tv []Timeval) error { + return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) + } + +-//sys fcntl(fd int, cmd int, arg int) (val int, err error) ++//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) ++} + + // TODO: wrap + // Acct(name nil-string) (err error) +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go +new file mode 100644 +index 00000000..6a15cba6 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go +@@ -0,0 +1,29 @@ ++// 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. ++ ++// +build darwin,go1.12,!go1.13 ++ ++package unix ++ ++import ( ++ "unsafe" ++) ++ ++func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ++ // To implement this using libSystem we'd need syscall_syscallPtr for ++ // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall ++ // back to raw syscalls for this func on Go 1.12. ++ var p unsafe.Pointer ++ if len(buf) > 0 { ++ p = unsafe.Pointer(&buf[0]) ++ } else { ++ p = unsafe.Pointer(&_zero) ++ } ++ r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) ++ n = int(r0) ++ if e1 != 0 { ++ return n, errnoErr(e1) ++ } ++ return n, nil ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go +new file mode 100644 +index 00000000..f911617b +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go +@@ -0,0 +1,101 @@ ++// 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. ++ ++// +build darwin,go1.13 ++ ++package unix ++ ++import "unsafe" ++ ++//sys closedir(dir uintptr) (err error) ++//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) ++ ++func fdopendir(fd int) (dir uintptr, err error) { ++ r0, _, e1 := syscall_syscallPtr(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" ++ ++func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ++ // Simulate Getdirentries using fdopendir/readdir_r/closedir. ++ // We store the number of entries to skip in the seek ++ // offset of fd. See issue #31368. ++ // It's not the full required semantics, but should handle the case ++ // of calling Getdirentries or ReadDirent repeatedly. ++ // It won't handle assigning the results of lseek to *basep, or handle ++ // the directory being edited underfoot. ++ skip, err := Seek(fd, 0, 1 /* SEEK_CUR */) ++ if err != nil { ++ return 0, err ++ } ++ ++ // We need to duplicate the incoming file descriptor ++ // because the caller expects to retain control of it, but ++ // fdopendir expects to take control of its argument. ++ // Just Dup'ing the file descriptor is not enough, as the ++ // result shares underlying state. Use Openat to make a really ++ // new file descriptor referring to the same directory. ++ fd2, err := Openat(fd, ".", O_RDONLY, 0) ++ if err != nil { ++ return 0, err ++ } ++ d, err := fdopendir(fd2) ++ if err != nil { ++ Close(fd2) ++ return 0, err ++ } ++ defer closedir(d) ++ ++ var cnt int64 ++ for { ++ var entry Dirent ++ var entryp *Dirent ++ e := readdir_r(d, &entry, &entryp) ++ if e != 0 { ++ return n, errnoErr(e) ++ } ++ if entryp == nil { ++ break ++ } ++ if skip > 0 { ++ skip-- ++ cnt++ ++ continue ++ } ++ reclen := int(entry.Reclen) ++ if reclen > len(buf) { ++ // Not enough room. Return for now. ++ // The counter will let us know where we should start up again. ++ // Note: this strategy for suspending in the middle and ++ // restarting is O(n^2) in the length of the directory. Oh well. ++ break ++ } ++ // Copy entry into return buffer. ++ s := struct { ++ ptr unsafe.Pointer ++ siz int ++ cap int ++ }{ptr: unsafe.Pointer(&entry), siz: reclen, cap: reclen} ++ copy(buf, *(*[]byte)(unsafe.Pointer(&s))) ++ buf = buf[reclen:] ++ n += reclen ++ cnt++ ++ } ++ // Set the seek offset of the input fd to record ++ // how many files we've already returned. ++ _, err = Seek(fd, cnt, 0 /* SEEK_SET */) ++ if err != nil { ++ return n, err ++ } ++ ++ return n, nil ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go +index ad74a11f..9a5a6ee5 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go +@@ -13,7 +13,7 @@ + package unix + + import ( +- errorspkg "errors" ++ "errors" + "syscall" + "unsafe" + ) +@@ -36,6 +36,7 @@ func Getwd() (string, error) { + return "", ENOTSUP + } + ++// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. + type SockaddrDatalink struct { + Len uint8 + Family uint8 +@@ -54,7 +55,7 @@ func nametomib(name string) (mib []_C_int, err error) { + + // NOTE(rsc): It seems strange to set the buffer to have + // size CTL_MAXNAME+2 but use only CTL_MAXNAME +- // as the size. I don't know why the +2 is here, but the ++ // as the size. I don't know why the +2 is here, but the + // kernel uses +2 for its own implementation of this function. + // I am scared that if we don't include the +2 here, the kernel + // will silently write 2 words farther than we specify +@@ -88,7 +89,6 @@ func direntNamlen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) + } + +-//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) + func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) } + func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) } + +@@ -109,7 +109,7 @@ type attrList struct { + + func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) { + if len(attrBuf) < 4 { +- return nil, errorspkg.New("attrBuf too small") ++ return nil, errors.New("attrBuf too small") + } + attrList.bitmapCount = attrBitMapCount + +@@ -119,17 +119,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])) + +@@ -145,12 +136,12 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( + for i := uint32(0); int(i) < len(dat); { + header := dat[i:] + if len(header) < 8 { +- return attrs, errorspkg.New("truncated attribute header") ++ return attrs, errors.New("truncated attribute header") + } + datOff := *(*int32)(unsafe.Pointer(&header[0])) + attrLen := *(*uint32)(unsafe.Pointer(&header[4])) + if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) { +- return attrs, errorspkg.New("truncated results; attrBuf too small") ++ return attrs, errors.New("truncated results; attrBuf too small") + } + end := uint32(datOff) + attrLen + attrs = append(attrs, dat[datOff:end]) +@@ -162,6 +153,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) { +@@ -179,14 +172,141 @@ 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 getfsstat(_p0, bufsize, flags) ++} ++ ++func xattrPointer(dest []byte) *byte { ++ // It's only when dest is set to NULL that the OS X implementations of ++ // getxattr() and listxattr() return the current sizes of the named attributes. ++ // An empty byte array is not sufficient. To maintain the same behaviour as the ++ // linux implementation, we wrap around the system calls and pass in NULL when ++ // dest is empty. ++ var destp *byte ++ if len(dest) > 0 { ++ destp = &dest[0] + } +- return ++ return destp ++} ++ ++//sys getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) ++ ++func Getxattr(path string, attr string, dest []byte) (sz int, err error) { ++ return getxattr(path, attr, xattrPointer(dest), len(dest), 0, 0) ++} ++ ++func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { ++ return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW) ++} ++ ++//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 ++ // linux system call, specifically the position parameter: ++ // ++ // linux: ++ // int setxattr( ++ // const char *path, ++ // const char *name, ++ // const void *value, ++ // size_t size, ++ // int flags ++ // ); ++ // ++ // darwin: ++ // int setxattr( ++ // const char *path, ++ // const char *name, ++ // void *value, ++ // size_t size, ++ // u_int32_t position, ++ // int options ++ // ); ++ // ++ // position specifies the offset within the extended attribute. In the ++ // current implementation, only the resource fork extended attribute makes ++ // use of this argument. For all others, position is reserved. We simply ++ // default to setting it to zero. ++ return setxattr(path, attr, xattrPointer(data), len(data), 0, flags) ++} ++ ++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 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 ++ // implementation of removexattr, we do so for interoperability with the ++ // linux variant. ++ return removexattr(path, attr, 0) ++} ++ ++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) { ++ return listxattr(path, xattrPointer(dest), len(dest), 0) + } + ++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 { ++ return err ++ } ++ ++ var attrList attrList ++ attrList.bitmapCount = ATTR_BIT_MAP_COUNT ++ attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME ++ ++ // order is mtime, atime: the opposite of Chtimes ++ attributes := [2]Timespec{times[1], times[0]} ++ options := 0 ++ if flags&AT_SYMLINK_NOFOLLOW != 0 { ++ options |= FSOPT_NOFOLLOW ++ } ++ return setattrlist( ++ _p0, ++ unsafe.Pointer(&attrList), ++ unsafe.Pointer(&attributes), ++ unsafe.Sizeof(attributes), ++ options) ++} ++ ++//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) ++ + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { + // Darwin doesn't support SYS_UTIMENSAT + return ENOSYS +@@ -196,49 +316,74 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { + * Wrapped + */ + ++//sys fcntl(fd int, cmd int, arg int) (val int, err error) ++ + //sys kill(pid int, signum int, posix int) (err error) + + func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 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. ++//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL + +-// 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 Uname(uname *Utsname) error { ++ mib := []_C_int{CTL_KERN, KERN_OSTYPE} ++ n := unsafe.Sizeof(uname.Sysname) ++ if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { ++ return err ++ } + +-func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) +-} ++ mib = []_C_int{CTL_KERN, KERN_HOSTNAME} ++ n = unsafe.Sizeof(uname.Nodename) ++ if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { ++ return err ++ } + +-func IoctlSetTermios(fd int, req uint, value *Termios) error { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) +-} ++ mib = []_C_int{CTL_KERN, KERN_OSRELEASE} ++ n = unsafe.Sizeof(uname.Release) ++ if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { ++ return err ++ } + +-// 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 +-} ++ mib = []_C_int{CTL_KERN, KERN_VERSION} ++ n = unsafe.Sizeof(uname.Version) ++ if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { ++ return err ++ } + +-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { +- var value Winsize +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) +- return &value, err ++ // The version might have newlines or tabs in it, convert them to ++ // spaces. ++ for i, b := range uname.Version { ++ if b == '\n' || b == '\t' { ++ if i == len(uname.Version)-1 { ++ uname.Version[i] = 0 ++ } else { ++ uname.Version[i] = ' ' ++ } ++ } ++ } ++ ++ mib = []_C_int{CTL_HW, HW_MACHINE} ++ n = unsafe.Sizeof(uname.Machine) ++ if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ return nil + } + +-func IoctlGetTermios(fd int, req uint) (*Termios, error) { +- var value Termios +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) +- return &value, err ++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 + */ +@@ -249,6 +394,7 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) { + //sys Chmod(path string, mode uint32) (err error) + //sys Chown(path string, uid int, gid int) (err error) + //sys Chroot(path string) (err error) ++//sys ClockGettime(clockid int32, time *Timespec) (err error) + //sys Close(fd int) (err error) + //sys Dup(fd int) (nfd int, err error) + //sys Dup2(from int, to int) (err error) +@@ -263,11 +409,8 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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 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) +@@ -287,7 +430,6 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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) +@@ -305,7 +447,7 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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 +-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sys Setegid(egid int) (err error) + //sysnb Seteuid(euid int) (err error) + //sysnb Setgid(gid int) (err error) +@@ -319,8 +461,6 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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) +@@ -377,18 +517,9 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) { + // Searchfs + // Delete + // Copyfile +-// Poll + // Watchevent + // Waitevent + // Modwatch +-// Getxattr +-// Fgetxattr +-// Setxattr +-// Fsetxattr +-// Removexattr +-// Fremovexattr +-// Listxattr +-// Flistxattr + // Fsctl + // Initgroups + // Posix_spawn +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go +new file mode 100644 +index 00000000..6b223f91 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.1_11.go +@@ -0,0 +1,9 @@ ++// 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. ++ ++// +build darwin,386,!go1.12 ++ ++package unix ++ ++//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go +index c172a3da..707ba4f5 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_darwin_386.go ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_386.go +@@ -8,30 +8,22 @@ package unix + + import ( + "syscall" +- "unsafe" + ) + +-func Getpagesize() int { return 4096 } ++//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int32(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: int32(sec), Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int32(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: int32(sec), Usec: int32(usec)} + } + + //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) + func Gettimeofday(tv *Timeval) (err error) { + // The tv passed to gettimeofday must be non-nil +- // but is otherwise unused. The answers come back ++ // but is otherwise unused. The answers come back + // in the two registers. + sec, usec, err := gettimeofday(tv) + tv.Sec = int32(sec) +@@ -53,21 +45,12 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + +-func (cmsg *Cmsghdr) SetLen(length int) { +- cmsg.Len = uint32(length) ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(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 (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) +@@ -75,3 +58,11 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, + // 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 getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 ++//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 ++//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 ++//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go +new file mode 100644 +index 00000000..68ebd6fa +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.1_11.go +@@ -0,0 +1,9 @@ ++// 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. ++ ++// +build darwin,amd64,!go1.12 ++ ++package unix ++ ++//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +index c6c99c13..fdbfb591 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +@@ -8,30 +8,22 @@ package unix + + import ( + "syscall" +- "unsafe" + ) + +-func Getpagesize() int { return 4096 } ++//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) + func Gettimeofday(tv *Timeval) (err error) { + // The tv passed to gettimeofday must be non-nil +- // but is otherwise unused. The answers come back ++ // but is otherwise unused. The answers come back + // in the two registers. + sec, usec, err := gettimeofday(tv) + tv.Sec = sec +@@ -53,21 +45,12 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + +-func (cmsg *Cmsghdr) SetLen(length int) { +- cmsg.Len = uint32(length) ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(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 (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) +@@ -75,3 +58,11 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, + // 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 getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 ++//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 ++//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 ++//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go +new file mode 100644 +index 00000000..0e3f25ac +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go +@@ -0,0 +1,11 @@ ++// Copyright 2019 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build darwin,arm,!go1.12 ++ ++package unix ++ ++func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ++ return 0, ENOSYS ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go +index d286cf40..f8bc4cfb 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go +@@ -6,30 +6,24 @@ package unix + + import ( + "syscall" +- "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ++func ptrace(request int, pid int, addr uintptr, data uintptr) error { ++ return ENOTSUP ++} + +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int32(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: int32(sec), Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int32(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: int32(sec), Usec: int32(usec)} + } + + //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) + func Gettimeofday(tv *Timeval) (err error) { + // The tv passed to gettimeofday must be non-nil +- // but is otherwise unused. The answers come back ++ // but is otherwise unused. The answers come back + // in the two registers. + sec, usec, err := gettimeofday(tv) + tv.Sec = int32(sec) +@@ -51,21 +45,24 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + +-func (cmsg *Cmsghdr) SetLen(length int) { +- cmsg.Len = uint32(length) ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(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 (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) + } + + 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) +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go +new file mode 100644 +index 00000000..01d45040 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.1_11.go +@@ -0,0 +1,11 @@ ++// Copyright 2019 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build darwin,arm64,!go1.12 ++ ++package unix ++ ++func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { ++ return 0, ENOSYS ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +index c33905cd..5ede3ac3 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +@@ -8,30 +8,24 @@ package unix + + import ( + "syscall" +- "unsafe" + ) + +-func Getpagesize() int { return 16384 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ++func ptrace(request int, pid int, addr uintptr, data uintptr) error { ++ return ENOTSUP ++} + +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) + func Gettimeofday(tv *Timeval) (err error) { + // The tv passed to gettimeofday must be non-nil +- // but is otherwise unused. The answers come back ++ // but is otherwise unused. The answers come back + // in the two registers. + sec, usec, err := gettimeofday(tv) + tv.Sec = sec +@@ -53,21 +47,12 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + +-func (cmsg *Cmsghdr) SetLen(length int) { +- cmsg.Len = uint32(length) ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(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 (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic +@@ -75,3 +60,11 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, + // 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) +diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +new file mode 100644 +index 00000000..f34c86c8 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +@@ -0,0 +1,33 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +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) ++func syscall_syscallPtr(fn, a1, a2, a3 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 ++//go:linkname syscall_syscallPtr syscall.syscallPtr ++ ++// Find the entry point for f. See comments in runtime/proc.go for the ++// function of the same name. ++//go:nosplit ++func funcPC(f func()) uintptr { ++ return **(**uintptr)(unsafe.Pointer(&f)) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +index 3a483373..8a195ae5 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go ++++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +@@ -12,8 +12,27 @@ + + package unix + +-import "unsafe" ++import ( ++ "sync" ++ "unsafe" ++) + ++// See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h ++var ( ++ osreldateOnce sync.Once ++ osreldate uint32 ++) ++ ++// First __DragonFly_version after September 2019 ABI changes ++// http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html ++const _dragonflyABIChangeVersion = 500705 ++ ++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 + Family uint8 +@@ -102,7 +121,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 +@@ -110,6 +129,23 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { + return + } + ++const ImplementsGetwd = true ++ ++//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD ++ ++func Getwd() (string, error) { ++ var buf [PathMax]byte ++ _, err := Getcwd(buf[0:]) ++ if err != nil { ++ return "", err ++ } ++ n := clen(buf[:]) ++ if n < 1 { ++ return "", EINVAL ++ } ++ return string(buf[:n]), nil ++} ++ + func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + var _p0 unsafe.Pointer + var bufsize uintptr +@@ -125,6 +161,85 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + return + } + ++func setattrlistTimes(path string, times []Timespec, flags int) error { ++ // used on Darwin for UtimesNano ++ return ENOSYS ++} ++ ++//sys ioctl(fd int, req uint, arg uintptr) (err error) ++ ++//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL ++ ++func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error { ++ err := sysctl(mib, old, oldlen, nil, 0) ++ if err != nil { ++ // Utsname members on Dragonfly are only 32 bytes and ++ // the syscall returns ENOMEM in case the actual value ++ // is longer. ++ if err == ENOMEM { ++ err = nil ++ } ++ } ++ return err ++} ++ ++func Uname(uname *Utsname) error { ++ mib := []_C_int{CTL_KERN, KERN_OSTYPE} ++ n := unsafe.Sizeof(uname.Sysname) ++ if err := sysctlUname(mib, &uname.Sysname[0], &n); err != nil { ++ return err ++ } ++ uname.Sysname[unsafe.Sizeof(uname.Sysname)-1] = 0 ++ ++ mib = []_C_int{CTL_KERN, KERN_HOSTNAME} ++ n = unsafe.Sizeof(uname.Nodename) ++ if err := sysctlUname(mib, &uname.Nodename[0], &n); err != nil { ++ return err ++ } ++ uname.Nodename[unsafe.Sizeof(uname.Nodename)-1] = 0 ++ ++ mib = []_C_int{CTL_KERN, KERN_OSRELEASE} ++ n = unsafe.Sizeof(uname.Release) ++ if err := sysctlUname(mib, &uname.Release[0], &n); err != nil { ++ return err ++ } ++ uname.Release[unsafe.Sizeof(uname.Release)-1] = 0 ++ ++ mib = []_C_int{CTL_KERN, KERN_VERSION} ++ n = unsafe.Sizeof(uname.Version) ++ if err := sysctlUname(mib, &uname.Version[0], &n); err != nil { ++ return err ++ } ++ ++ // The version might have newlines or tabs in it, convert them to ++ // spaces. ++ for i, b := range uname.Version { ++ if b == '\n' || b == '\t' { ++ if i == len(uname.Version)-1 { ++ uname.Version[i] = 0 ++ } else { ++ uname.Version[i] = ' ' ++ } ++ } ++ } ++ ++ mib = []_C_int{CTL_HW, HW_MACHINE} ++ n = unsafe.Sizeof(uname.Machine) ++ if err := sysctlUname(mib, &uname.Machine[0], &n); err != nil { ++ return err ++ } ++ uname.Machine[unsafe.Sizeof(uname.Machine)-1] = 0 ++ ++ 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 + */ +@@ -139,16 +254,21 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err 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) ++//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) + //sys Fstatfs(fd int, stat *Statfs_t) (err error) + //sys Fsync(fd int) (err error) + //sys Ftruncate(fd int, length int64) (err error) ++//sys Getdents(fd int, buf []byte) (n int, err error) + //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) + //sys Getdtablesize() (size int) + //sysnb Getegid() (egid int) +@@ -169,21 +289,26 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err 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) + //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 +-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sysnb Setegid(egid int) (err error) + //sysnb Seteuid(euid int) (err error) + //sysnb Setgid(gid int) (err error) +@@ -201,11 +326,13 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err 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) +@@ -225,7 +352,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // Getlogin + // Sigpending + // Sigaltstack +-// Ioctl + // Reboot + // Execve + // Vfork +@@ -257,7 +383,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // Searchfs + // Delete + // Copyfile +-// Poll + // Watchevent + // Waitevent + // Modwatch +@@ -403,7 +528,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // Pread_nocancel + // Pwrite_nocancel + // Waitid_nocancel +-// Poll_nocancel + // Msgsnd_nocancel + // Msgrcv_nocancel + // Sem_wait_nocancel +diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +index da7cb798..a6b4830a 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +@@ -11,21 +11,12 @@ import ( + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = nsec % 1e9 / 1e3 +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -42,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go +index d26e52ea..6932e7c2 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go ++++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go +@@ -12,8 +12,36 @@ + + package unix + +-import "unsafe" ++import ( ++ "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 + Family uint8 +@@ -32,7 +60,7 @@ func nametomib(name string) (mib []_C_int, err error) { + + // NOTE(rsc): It seems strange to set the buffer to have + // size CTL_MAXNAME+2 but use only CTL_MAXNAME +- // as the size. I don't know why the +2 is here, but the ++ // as the size. I don't know why the +2 is here, but the + // kernel uses +2 for its own implementation of this function. + // I am scared that if we don't include the +2 here, the kernel + // will silently write 2 words farther than we specify +@@ -66,14 +94,21 @@ func direntNamlen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) + } + +-//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) { +@@ -97,7 +132,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 +@@ -105,290 +140,421 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { + return + } + ++const ImplementsGetwd = true ++ ++//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD ++ ++func Getwd() (string, error) { ++ var buf [PathMax]byte ++ _, err := Getcwd(buf[0:]) ++ if err != nil { ++ return "", err ++ } ++ n := clen(buf[:]) ++ if n < 1 { ++ return "", EINVAL ++ } ++ return string(buf[:n]), nil ++} ++ + 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 + } + +-// Derive extattr namespace and attribute name ++func setattrlistTimes(path string, times []Timespec, flags int) error { ++ // used on Darwin for UtimesNano ++ return ENOSYS ++} + +-func xattrnamespace(fullattr string) (ns int, attr string, err error) { +- s := -1 +- for idx, val := range fullattr { +- if val == '.' { +- s = idx +- break +- } ++//sys ioctl(fd int, req uint, arg uintptr) (err error) ++ ++//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL ++ ++func Uname(uname *Utsname) error { ++ mib := []_C_int{CTL_KERN, KERN_OSTYPE} ++ n := unsafe.Sizeof(uname.Sysname) ++ if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { ++ return err + } + +- if s == -1 { +- return -1, "", ENOATTR ++ mib = []_C_int{CTL_KERN, KERN_HOSTNAME} ++ n = unsafe.Sizeof(uname.Nodename) ++ if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { ++ return err + } + +- namespace := fullattr[0:s] +- attr = fullattr[s+1:] ++ mib = []_C_int{CTL_KERN, KERN_OSRELEASE} ++ n = unsafe.Sizeof(uname.Release) ++ if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { ++ return err ++ } + +- switch namespace { +- case "user": +- return EXTATTR_NAMESPACE_USER, attr, nil +- case "system": +- return EXTATTR_NAMESPACE_SYSTEM, attr, nil +- default: +- return -1, "", ENOATTR ++ mib = []_C_int{CTL_KERN, KERN_VERSION} ++ n = unsafe.Sizeof(uname.Version) ++ if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { ++ return err + } +-} + +-func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) { +- if len(dest) > idx { +- return unsafe.Pointer(&dest[idx]) +- } else { +- return unsafe.Pointer(_zero) ++ // The version might have newlines or tabs in it, convert them to ++ // spaces. ++ for i, b := range uname.Version { ++ if b == '\n' || b == '\t' { ++ if i == len(uname.Version)-1 { ++ uname.Version[i] = 0 ++ } else { ++ uname.Version[i] = ' ' ++ } ++ } + } +-} + +-// FreeBSD implements its own syscalls to handle extended attributes ++ mib = []_C_int{CTL_HW, HW_MACHINE} ++ n = unsafe.Sizeof(uname.Machine) ++ if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { ++ return err ++ } + +-func Getxattr(file string, attr string, dest []byte) (sz int, err error) { +- d := initxattrdest(dest, 0) +- destsize := len(dest) ++ return nil ++} + +- nsid, a, err := xattrnamespace(attr) ++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 -1, err ++ return err + } + +- return ExtattrGetFile(file, nsid, a, uintptr(d), destsize) ++ st.convertFrom(&oldStat) ++ return nil + } + +-func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { +- d := initxattrdest(dest, 0) +- destsize := len(dest) +- +- nsid, a, err := xattrnamespace(attr) ++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 -1, err ++ return err + } + +- return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize) ++ st.convertFrom(&oldStat) ++ return nil + } + +-func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { +- d := initxattrdest(dest, 0) +- destsize := len(dest) +- +- nsid, a, err := xattrnamespace(attr) ++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 -1, err ++ return err + } + +- return ExtattrGetLink(link, nsid, a, uintptr(d), destsize) ++ st.convertFrom(&oldStat) ++ return nil + } + +-// 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) ++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 ++ return err + } + +- _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz) +- return ++ st.convertFrom(&oldStat) ++ return nil + } + +-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) ++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 ++ return err + } + +- _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz) +- return ++ st.convertFrom(&oldStatfs) ++ return nil + } + +-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) ++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 ++ return err + } + +- _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz) +- return ++ st.convertFrom(&oldStatfs) ++ return nil + } + +-func Removexattr(file string, attr string) (err error) { +- nsid, a, err := xattrnamespace(attr) +- if err != 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) { ++ if basep == nil || unsafe.Sizeof(*basep) == 8 { ++ return getdirentries_freebsd12(fd, buf, (*uint64)(unsafe.Pointer(basep))) ++ } ++ // The freebsd12 syscall needs a 64-bit base. On 32-bit machines ++ // we can't just use the basep passed in. See #32498. ++ var base uint64 = uint64(*basep) ++ n, err = getdirentries_freebsd12(fd, buf, &base) ++ *basep = uintptr(base) ++ if base>>32 != 0 { ++ // We can't stuff the base back into a uintptr, so any ++ // future calls would be suspect. Generate an error. ++ // EIO is allowed by getdirentries. ++ err = EIO ++ } + return + } + +- err = ExtattrDeleteFile(file, nsid, a) ++ // 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 Fremovexattr(fd int, attr string) (err error) { +- nsid, a, err := xattrnamespace(attr) +- if err != nil { +- 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) + } +- +- err = ExtattrDeleteFd(fd, nsid, a) +- return ++ oldDev = int(dev) ++ return mknod(path, mode, oldDev) + } + +-func Lremovexattr(link string, attr string) (err error) { +- nsid, a, err := xattrnamespace(attr) +- if err != nil { +- return ++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) ++} + +- err = ExtattrDeleteLink(link, nsid, a) +- return ++// 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 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 +- var e error +- 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 { +- e = nil +- continue +- } else if e != nil { +- return s, e +- } ++func (s *Stat_t) convertFrom(old *stat_freebsd11_t) { ++ *s = Stat_t{ ++ Dev: uint64(old.Dev), ++ Ino: uint64(old.Ino), ++ Nlink: uint64(old.Nlink), ++ Mode: old.Mode, ++ Uid: old.Uid, ++ Gid: old.Gid, ++ Rdev: uint64(old.Rdev), ++ Atim: old.Atim, ++ Mtim: old.Mtim, ++ Ctim: old.Ctim, ++ Btim: old.Btim, ++ Size: old.Size, ++ Blocks: old.Blocks, ++ Blksize: old.Blksize, ++ Flags: old.Flags, ++ Gen: uint64(old.Gen), ++ } ++} + +- s += stmp +- destsiz -= s +- if destsiz < 0 { +- destsiz = 0 +- } +- d = initxattrdest(dest, s) ++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 + } + +- return s, e ++ 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 Flistxattr(fd int, dest []byte) (sz int, err error) { +- d := initxattrdest(dest, 0) +- destsiz := len(dest) ++func convertFromDirents11(buf []byte, old []byte) int { ++ const ( ++ fixedSize = int(unsafe.Offsetof(Dirent{}.Name)) ++ oldFixedSize = int(unsafe.Offsetof(dirent_freebsd11{}.Name)) ++ ) ++ ++ dstPos := 0 ++ srcPos := 0 ++ for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) { ++ var dstDirent Dirent ++ var srcDirent dirent_freebsd11 + +- s := 0 +- var e error +- 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 { +- e = nil +- continue +- } else if e != nil { +- return s, e ++ // If multiple direntries are written, sometimes when we reach the final one, ++ // we may have cap of old less than size of dirent_freebsd11. ++ copy((*[unsafe.Sizeof(srcDirent)]byte)(unsafe.Pointer(&srcDirent))[:], old[srcPos:]) ++ ++ reclen := roundup(fixedSize+int(srcDirent.Namlen)+1, 8) ++ if dstPos+reclen > len(buf) { ++ break + } + +- s += stmp +- destsiz -= s +- if destsiz < 0 { +- destsiz = 0 ++ dstDirent.Fileno = uint64(srcDirent.Fileno) ++ dstDirent.Off = 0 ++ dstDirent.Reclen = uint16(reclen) ++ dstDirent.Type = srcDirent.Type ++ dstDirent.Pad0 = 0 ++ dstDirent.Namlen = uint16(srcDirent.Namlen) ++ dstDirent.Pad1 = 0 ++ ++ copy(dstDirent.Name[:], srcDirent.Name[:srcDirent.Namlen]) ++ copy(buf[dstPos:], (*[unsafe.Sizeof(dstDirent)]byte)(unsafe.Pointer(&dstDirent))[:]) ++ padding := buf[dstPos+fixedSize+int(dstDirent.Namlen) : dstPos+reclen] ++ for i := range padding { ++ padding[i] = 0 + } +- d = initxattrdest(dest, s) ++ ++ dstPos += int(dstDirent.Reclen) ++ srcPos += int(srcDirent.Reclen) + } + +- return s, e ++ return dstPos + } + +-func Llistxattr(link string, dest []byte) (sz int, err error) { +- d := initxattrdest(dest, 0) +- destsiz := len(dest) ++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) ++} + +- s := 0 +- var e error +- 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 { +- e = nil +- continue +- } else if e != nil { +- return s, e +- } ++//sys ptrace(request int, pid int, addr uintptr, data int) (err error) + +- s += stmp +- destsiz -= s +- if destsiz < 0 { +- destsiz = 0 +- } +- d = initxattrdest(dest, s) +- } ++func PtraceAttach(pid int) (err error) { ++ return ptrace(PTRACE_ATTACH, pid, 0, 0) ++} + +- return s, e ++func PtraceCont(pid int, signal int) (err error) { ++ return ptrace(PTRACE_CONT, pid, 1, signal) + } + +-//sys ioctl(fd int, req uint, arg uintptr) (err error) ++func PtraceDetach(pid int) (err error) { ++ return ptrace(PTRACE_DETACH, pid, 1, 0) ++} ++ ++func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) { ++ return ptrace(PTRACE_GETFPREGS, pid, uintptr(unsafe.Pointer(fpregsout)), 0) ++} + +-// ioctl itself should not be exposed directly, but additional get/set +-// functions for specific types are permissible. ++func PtraceGetRegs(pid int, regsout *Reg) (err error) { ++ return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0) ++} ++ ++func PtraceLwpEvents(pid int, enable int) (err error) { ++ return ptrace(PTRACE_LWPEVENTS, pid, 0, enable) ++} ++ ++func PtraceLwpInfo(pid int, info uintptr) (err error) { ++ return ptrace(PTRACE_LWPINFO, pid, info, int(unsafe.Sizeof(PtraceLwpInfoStruct{}))) ++} + +-// 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 PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) { ++ return PtraceIO(PIOD_READ_D, pid, addr, out, SizeofLong) + } + +-func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) { ++ return PtraceIO(PIOD_READ_I, pid, addr, out, SizeofLong) + } + +-func IoctlSetTermios(fd int, req uint, value *Termios) error { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) { ++ return PtraceIO(PIOD_WRITE_D, pid, addr, data, SizeofLong) + } + +-// 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 PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) { ++ return PtraceIO(PIOD_WRITE_I, pid, addr, data, SizeofLong) + } + +-func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { +- var value Winsize +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) +- return &value, err ++func PtraceSetRegs(pid int, regs *Reg) (err error) { ++ return ptrace(PTRACE_SETREGS, pid, uintptr(unsafe.Pointer(regs)), 0) + } + +-func IoctlGetTermios(fd int, req uint) (*Termios, error) { +- var value Termios +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) +- return &value, err ++func PtraceSingleStep(pid int) (err error) { ++ return ptrace(PTRACE_SINGLESTEP, pid, 1, 0) + } + + /* +@@ -430,11 +596,16 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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 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 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 *uint64) (n int, err error) + //sys Getdtablesize() (size int) + //sysnb Getegid() (egid int) + //sysnb Geteuid() (uid int) +@@ -456,11 +627,13 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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) +@@ -475,7 +648,7 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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 +-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sysnb Setegid(egid int) (err error) + //sysnb Seteuid(euid int) (err error) + //sysnb Setgid(gid int) (err error) +@@ -490,8 +663,9 @@ func IoctlGetTermios(fd int, req uint) (*Termios, 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) +@@ -546,22 +720,14 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) { + // Kqueue_portset + // Getattrlist + // Setattrlist ++// Getdents + // Getdirentriesattr + // Searchfs + // Delete + // Copyfile +-// Poll + // Watchevent + // Waitevent + // Modwatch +-// Getxattr +-// Fgetxattr +-// Setxattr +-// Fsetxattr +-// Removexattr +-// Fremovexattr +-// Listxattr +-// Flistxattr + // Fsctl + // Initgroups + // Posix_spawn +diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +index 6a0cd804..72a506dd 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go ++++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +@@ -11,21 +11,12 @@ import ( + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int32(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: int32(sec), Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int32(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: int32(sec), Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -42,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +@@ -59,3 +54,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ++ ++func PtraceGetFsBase(pid int, fsbase *int64) (err error) { ++ return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) ++} ++ ++func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { ++ ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} ++ err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) ++ return int(ioDesc.Len), err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +index e142540e..d5e376ac 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +@@ -11,21 +11,12 @@ import ( + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = nsec % 1e9 / 1e3 +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -42,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +@@ -59,3 +54,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ++ ++func PtraceGetFsBase(pid int, fsbase *int64) (err error) { ++ return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) ++} ++ ++func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { ++ ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} ++ err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) ++ return int(ioDesc.Len), err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +index 5504cb12..4ea45bce 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go ++++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +@@ -11,21 +11,12 @@ import ( + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = nsec / 1e9 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -42,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +@@ -59,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ++ ++func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { ++ ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} ++ err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) ++ return int(ioDesc.Len), err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +similarity index 59% +copy from vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +copy to vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +index da7cb798..aa5326db 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +@@ -1,8 +1,8 @@ +-// Copyright 2009 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. + +-// +build amd64,dragonfly ++// +build arm64,freebsd + + package unix + +@@ -11,21 +11,12 @@ import ( + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = nsec % 1e9 / 1e3 +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -42,6 +33,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +@@ -59,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + } + + func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) ++ ++func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { ++ ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} ++ err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) ++ return int(ioDesc.Len), err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go +new file mode 100644 +index 00000000..99e62dcd +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go +@@ -0,0 +1,57 @@ ++// 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. ++ ++// illumos system calls not present on Solaris. ++ ++// +build amd64,illumos ++ ++package unix ++ ++import "unsafe" ++ ++func bytes2iovec(bs [][]byte) []Iovec { ++ iovecs := make([]Iovec, len(bs)) ++ for i, b := range bs { ++ iovecs[i].SetLen(len(b)) ++ if len(b) > 0 { ++ // somehow Iovec.Base on illumos is (*int8), not (*byte) ++ iovecs[i].Base = (*int8)(unsafe.Pointer(&b[0])) ++ } else { ++ iovecs[i].Base = (*int8)(unsafe.Pointer(&_zero)) ++ } ++ } ++ return iovecs ++} ++ ++//sys readv(fd int, iovs []Iovec) (n int, err error) ++ ++func Readv(fd int, iovs [][]byte) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ n, err = readv(fd, iovecs) ++ return n, err ++} ++ ++//sys preadv(fd int, iovs []Iovec, off int64) (n int, err error) ++ ++func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ n, err = preadv(fd, iovecs, off) ++ return n, err ++} ++ ++//sys writev(fd int, iovs []Iovec) (n int, err error) ++ ++func Writev(fd int, iovs [][]byte) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ n, err = writev(fd, iovecs) ++ return n, err ++} ++ ++//sys pwritev(fd int, iovs []Iovec, off int64) (n int, err error) ++ ++func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ n, err = pwritev(fd, iovecs, off) ++ return n, err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go +index 1b7d59d8..bbe1abbc 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux.go +@@ -12,6 +12,8 @@ + package unix + + import ( ++ "encoding/binary" ++ "runtime" + "syscall" + "unsafe" + ) +@@ -36,6 +38,20 @@ func Creat(path string, mode uint32) (fd int, err error) { + return Open(path, O_CREAT|O_WRONLY|O_TRUNC, mode) + } + ++//sys FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) ++//sys fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) ++ ++func FanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname string) (err error) { ++ if pathname == "" { ++ return fanotifyMark(fd, flags, mask, dirFd, nil) ++ } ++ p, err := BytePtrFromString(pathname) ++ if err != nil { ++ return err ++ } ++ return fanotifyMark(fd, flags, mask, dirFd, p) ++} ++ + //sys fchmodat(dirfd int, path string, mode uint32) (err error) + + func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { +@@ -55,37 +71,41 @@ 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. + +-// 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)) ++// IoctlRetInt performs an ioctl operation specified by req on a device ++// associated with opened file descriptor fd, and returns a non-negative ++// integer that is returned by the ioctl syscall. ++func IoctlRetInt(fd int, req uint) (int, error) { ++ ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) ++ if err != 0 { ++ return 0, err ++ } ++ return int(ret), nil + } + +-func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++// 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))) + } + +-func IoctlSetTermios(fd int, req uint, value *Termios) error { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++func IoctlSetRTCTime(fd int, value *RTCTime) error { ++ err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value))) ++ runtime.KeepAlive(value) ++ return err + } + +-// 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 ++func IoctlGetUint32(fd int, req uint) (uint32, error) { ++ var value uint32 + 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))) ++func IoctlGetRTCTime(fd int) (*RTCTime, error) { ++ var value RTCTime ++ err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) + return &value, err + } + +@@ -148,8 +168,6 @@ func Unlink(path string) error { + + //sys Unlinkat(dirfd int, path string, flags int) (err error) + +-//sys utimes(path string, times *[2]Timeval) (err error) +- + func Utimes(path string, tv []Timeval) error { + if tv == nil { + err := utimensat(AT_FDCWD, path, nil, 0) +@@ -207,20 +225,14 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { + return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) + } + +-//sys futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) +- + func Futimesat(dirfd int, path string, tv []Timeval) error { +- pathp, err := BytePtrFromString(path) +- if err != nil { +- return err +- } + if tv == nil { +- return futimesat(dirfd, pathp, nil) ++ return futimesat(dirfd, path, nil) + } + if len(tv) != 2 { + return EINVAL + } +- return futimesat(dirfd, pathp, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) ++ return futimesat(dirfd, path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) + } + + func Futimes(fd int, tv []Timeval) (err error) { +@@ -255,7 +267,7 @@ func Getgroups() (gids []int, err error) { + return nil, nil + } + +- // Sanity check group count. Max is 1<<16 on Linux. ++ // Sanity check group count. Max is 1<<16 on Linux. + if n < 0 || n > 1<<20 { + return nil, EINVAL + } +@@ -290,8 +302,8 @@ type WaitStatus uint32 + // 0x7F (stopped), or a signal number that caused an exit. + // The 0x80 bit is whether there was a core dump. + // An extra number (exit code, signal causing a stop) +-// is in the high bits. At least that's the idea. +-// There are various irregularities. For example, the ++// is in the high bits. At least that's the idea. ++// There are various irregularities. For example, the + // "continued" status is 0xFFFF, distinguishing itself + // from stopped via the core dump bit. + +@@ -413,6 +425,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { + return unsafe.Pointer(&sa.raw), sl, nil + } + ++// SockaddrLinklayer implements the Sockaddr interface for AF_PACKET type sockets. + type SockaddrLinklayer struct { + Protocol uint16 + Ifindex int +@@ -439,6 +452,7 @@ func (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) { + return unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil + } + ++// SockaddrNetlink implements the Sockaddr interface for AF_NETLINK type sockets. + type SockaddrNetlink struct { + Family uint16 + Pad uint16 +@@ -455,6 +469,8 @@ func (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) { + return unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil + } + ++// SockaddrHCI implements the Sockaddr interface for AF_BLUETOOTH type sockets ++// using the HCI protocol. + type SockaddrHCI struct { + Dev uint16 + Channel uint16 +@@ -468,6 +484,72 @@ func (sa *SockaddrHCI) sockaddr() (unsafe.Pointer, _Socklen, error) { + return unsafe.Pointer(&sa.raw), SizeofSockaddrHCI, nil + } + ++// SockaddrL2 implements the Sockaddr interface for AF_BLUETOOTH type sockets ++// using the L2CAP protocol. ++type SockaddrL2 struct { ++ PSM uint16 ++ CID uint16 ++ Addr [6]uint8 ++ AddrType uint8 ++ raw RawSockaddrL2 ++} ++ ++func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { ++ sa.raw.Family = AF_BLUETOOTH ++ psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm)) ++ psm[0] = byte(sa.PSM) ++ psm[1] = byte(sa.PSM >> 8) ++ for i := 0; i < len(sa.Addr); i++ { ++ sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i] ++ } ++ cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid)) ++ cid[0] = byte(sa.CID) ++ cid[1] = byte(sa.CID >> 8) ++ sa.raw.Bdaddr_type = sa.AddrType ++ 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 +@@ -630,7 +712,168 @@ 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 []byte ++ 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 ++} ++ ++// SockaddrTIPC implements the Sockaddr interface for AF_TIPC type sockets. ++// For more information on TIPC, see: http://tipc.sourceforge.net/. ++type SockaddrTIPC struct { ++ // Scope is the publication scopes when binding service/service range. ++ // Should be set to TIPC_CLUSTER_SCOPE or TIPC_NODE_SCOPE. ++ Scope int ++ ++ // Addr is the type of address used to manipulate a socket. Addr must be ++ // one of: ++ // - *TIPCSocketAddr: "id" variant in the C addr union ++ // - *TIPCServiceRange: "nameseq" variant in the C addr union ++ // - *TIPCServiceName: "name" variant in the C addr union ++ // ++ // If nil, EINVAL will be returned when the structure is used. ++ Addr TIPCAddr ++ ++ raw RawSockaddrTIPC ++} ++ ++// TIPCAddr is implemented by types that can be used as an address for ++// SockaddrTIPC. It is only implemented by *TIPCSocketAddr, *TIPCServiceRange, ++// and *TIPCServiceName. ++type TIPCAddr interface { ++ tipcAddrtype() uint8 ++ tipcAddr() [12]byte ++} ++ ++func (sa *TIPCSocketAddr) tipcAddr() [12]byte { ++ var out [12]byte ++ copy(out[:], (*(*[unsafe.Sizeof(TIPCSocketAddr{})]byte)(unsafe.Pointer(sa)))[:]) ++ return out ++} ++ ++func (sa *TIPCSocketAddr) tipcAddrtype() uint8 { return TIPC_SOCKET_ADDR } ++ ++func (sa *TIPCServiceRange) tipcAddr() [12]byte { ++ var out [12]byte ++ copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceRange{})]byte)(unsafe.Pointer(sa)))[:]) ++ return out ++} ++ ++func (sa *TIPCServiceRange) tipcAddrtype() uint8 { return TIPC_SERVICE_RANGE } ++ ++func (sa *TIPCServiceName) tipcAddr() [12]byte { ++ var out [12]byte ++ copy(out[:], (*(*[unsafe.Sizeof(TIPCServiceName{})]byte)(unsafe.Pointer(sa)))[:]) ++ return out ++} ++ ++func (sa *TIPCServiceName) tipcAddrtype() uint8 { return TIPC_SERVICE_ADDR } ++ ++func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) { ++ if sa.Addr == nil { ++ return nil, 0, EINVAL ++ } ++ ++ sa.raw.Family = AF_TIPC ++ sa.raw.Scope = int8(sa.Scope) ++ sa.raw.Addrtype = sa.Addr.tipcAddrtype() ++ sa.raw.Addr = sa.Addr.tipcAddr() ++ ++ return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil ++} ++ ++// SockaddrL2TPIP implements the Sockaddr interface for IPPROTO_L2TP/AF_INET sockets. ++type SockaddrL2TPIP struct { ++ Addr [4]byte ++ ConnId uint32 ++ raw RawSockaddrL2TPIP ++} ++ ++func (sa *SockaddrL2TPIP) sockaddr() (unsafe.Pointer, _Socklen, error) { ++ sa.raw.Family = AF_INET ++ sa.raw.Conn_id = sa.ConnId ++ for i := 0; i < len(sa.Addr); i++ { ++ sa.raw.Addr[i] = sa.Addr[i] ++ } ++ return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP, nil ++} ++ ++// SockaddrL2TPIP6 implements the Sockaddr interface for IPPROTO_L2TP/AF_INET6 sockets. ++type SockaddrL2TPIP6 struct { ++ Addr [16]byte ++ ZoneId uint32 ++ ConnId uint32 ++ raw RawSockaddrL2TPIP6 ++} ++ ++func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) { ++ sa.raw.Family = AF_INET6 ++ sa.raw.Conn_id = sa.ConnId ++ 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), SizeofSockaddrL2TPIP6, nil ++} ++ ++func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { + switch rsa.Addr.Family { + case AF_NETLINK: + pp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa)) +@@ -675,30 +918,63 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { + for n < len(pp.Path) && pp.Path[n] != 0 { + n++ + } +- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] ++ bytes := (*[len(pp.Path)]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] ++ proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL) ++ if err != nil { ++ return nil, err ++ } ++ ++ switch proto { ++ case IPPROTO_L2TP: ++ pp := (*RawSockaddrL2TPIP)(unsafe.Pointer(rsa)) ++ sa := new(SockaddrL2TPIP) ++ sa.ConnId = pp.Conn_id ++ for i := 0; i < len(sa.Addr); i++ { ++ sa.Addr[i] = pp.Addr[i] ++ } ++ return sa, nil ++ default: ++ 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 + } +- 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] ++ proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL) ++ if err != nil { ++ return nil, err ++ } ++ ++ switch proto { ++ case IPPROTO_L2TP: ++ pp := (*RawSockaddrL2TPIP6)(unsafe.Pointer(rsa)) ++ sa := new(SockaddrL2TPIP6) ++ sa.ConnId = pp.Conn_id ++ sa.ZoneId = pp.Scope_id ++ for i := 0; i < len(sa.Addr); i++ { ++ sa.Addr[i] = pp.Addr[i] ++ } ++ return sa, nil ++ default: ++ 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 sa, nil + + case AF_VSOCK: + pp := (*RawSockaddrVM)(unsafe.Pointer(rsa)) +@@ -706,6 +982,76 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { + CID: pp.Cid, + 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: pp[8:14], ++ } ++ for i := 14; i < 14+IFNAMSIZ; i++ { ++ if pp[i] == 0 { ++ sa.Dev = string(pp[14:i]) ++ break ++ } ++ } ++ return sa, nil ++ case AF_TIPC: ++ pp := (*RawSockaddrTIPC)(unsafe.Pointer(rsa)) ++ ++ sa := &SockaddrTIPC{ ++ Scope: int(pp.Scope), ++ } ++ ++ // Determine which union variant is present in pp.Addr by checking ++ // pp.Addrtype. ++ switch pp.Addrtype { ++ case TIPC_SERVICE_RANGE: ++ sa.Addr = (*TIPCServiceRange)(unsafe.Pointer(&pp.Addr)) ++ case TIPC_SERVICE_ADDR: ++ sa.Addr = (*TIPCServiceName)(unsafe.Pointer(&pp.Addr)) ++ case TIPC_SOCKET_ADDR: ++ sa.Addr = (*TIPCSocketAddr)(unsafe.Pointer(&pp.Addr)) ++ default: ++ return nil, EINVAL ++ } ++ + return sa, nil + } + return nil, EAFNOSUPPORT +@@ -718,7 +1064,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 +@@ -736,7 +1082,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 +@@ -750,20 +1096,7 @@ func Getsockname(fd int) (sa Sockaddr, err error) { + if err = getsockname(fd, &rsa, &len); err != nil { + return + } +- return anyToSockaddr(&rsa) +-} +- +-func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) { +- vallen := _Socklen(4) +- err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) +- return value, err +-} +- +-func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) { +- var value IPMreq +- vallen := _Socklen(SizeofIPMreq) +- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) +- return &value, err ++ return anyToSockaddr(fd, &rsa) + } + + func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { +@@ -773,37 +1106,48 @@ func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { + return &value, err + } + +-func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { +- var value IPv6Mreq +- vallen := _Socklen(SizeofIPv6Mreq) ++func GetsockoptUcred(fd, level, opt int) (*Ucred, error) { ++ var value Ucred ++ vallen := _Socklen(SizeofUcred) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err + } + +-func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) { +- var value IPv6MTUInfo +- vallen := _Socklen(SizeofIPv6MTUInfo) ++func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { ++ var value TCPInfo ++ vallen := _Socklen(SizeofTCPInfo) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err + } + +-func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) { +- var value ICMPv6Filter +- vallen := _Socklen(SizeofICMPv6Filter) +- err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) +- return &value, err ++// GetsockoptString returns the string value of the socket option opt for the ++// socket associated with fd at the given socket level. ++func GetsockoptString(fd, level, opt int) (string, error) { ++ buf := make([]byte, 256) ++ vallen := _Socklen(len(buf)) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) ++ if err != nil { ++ if err == ERANGE { ++ buf = make([]byte, vallen) ++ err = getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) ++ } ++ if err != nil { ++ return "", err ++ } ++ } ++ return string(buf[:vallen-1]), nil + } + +-func GetsockoptUcred(fd, level, opt int) (*Ucred, error) { +- var value Ucred +- vallen := _Socklen(SizeofUcred) ++func GetsockoptTpacketStats(fd, level, opt int) (*TpacketStats, error) { ++ var value TpacketStats ++ vallen := _Socklen(SizeofTpacketStats) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err + } + +-func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) { +- var value TCPInfo +- vallen := _Socklen(SizeofTCPInfo) ++func GetsockoptTpacketStatsV3(fd, level, opt int) (*TpacketStatsV3, error) { ++ var value TpacketStatsV3 ++ vallen := _Socklen(SizeofTpacketStatsV3) + err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) + return &value, err + } +@@ -812,6 +1156,32 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) + } + ++func SetsockoptPacketMreq(fd, level, opt int, mreq *PacketMreq) error { ++ return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq)) ++} ++ ++// SetsockoptSockFprog attaches a classic BPF or an extended BPF program to a ++// socket to filter incoming packets. See 'man 7 socket' for usage information. ++func SetsockoptSockFprog(fd, level, opt int, fprog *SockFprog) error { ++ return setsockopt(fd, level, opt, unsafe.Pointer(fprog), unsafe.Sizeof(*fprog)) ++} ++ ++func SetsockoptCanRawFilter(fd, level, opt int, filter []CanFilter) error { ++ var p unsafe.Pointer ++ if len(filter) > 0 { ++ p = unsafe.Pointer(&filter[0]) ++ } ++ return setsockopt(fd, level, opt, p, uintptr(len(filter)*SizeofCanFilter)) ++} ++ ++func SetsockoptTpacketReq(fd, level, opt int, tp *TpacketReq) error { ++ return setsockopt(fd, level, opt, unsafe.Pointer(tp), unsafe.Sizeof(*tp)) ++} ++ ++func SetsockoptTpacketReq3(fd, level, opt int, tp *TpacketReq3) error { ++ return setsockopt(fd, level, opt, unsafe.Pointer(tp), unsafe.Sizeof(*tp)) ++} ++ + // Keyctl Commands (http://man7.org/linux/man-pages/man2/keyctl.2.html) + + // KeyctlInt calls keyctl commands in which each argument is an int. +@@ -919,6 +1289,34 @@ func KeyctlDHCompute(params *KeyctlDHParams, buffer []byte) (size int, err error + return keyctlDH(KEYCTL_DH_COMPUTE, params, buffer) + } + ++// KeyctlRestrictKeyring implements the KEYCTL_RESTRICT_KEYRING command. This ++// command limits the set of keys that can be linked to the keyring, regardless ++// of keyring permissions. The command requires the "setattr" permission. ++// ++// When called with an empty keyType the command locks the keyring, preventing ++// any further keys from being linked to the keyring. ++// ++// The "asymmetric" keyType defines restrictions requiring key payloads to be ++// DER encoded X.509 certificates signed by keys in another keyring. Restrictions ++// for "asymmetric" include "builtin_trusted", "builtin_and_secondary_trusted", ++// "key_or_keyring:<key>", and "key_or_keyring:<key>:chain". ++// ++// As of Linux 4.12, only the "asymmetric" keyType defines type-specific ++// restrictions. ++// ++// See the full documentation at: ++// http://man7.org/linux/man-pages/man3/keyctl_restrict_keyring.3.html ++// http://man7.org/linux/man-pages/man2/keyctl.2.html ++func KeyctlRestrictKeyring(ringid int, keyType string, restriction string) error { ++ if keyType == "" { ++ return keyctlRestrictKeyring(KEYCTL_RESTRICT_KEYRING, ringid) ++ } ++ return keyctlRestrictKeyringByType(KEYCTL_RESTRICT_KEYRING, ringid, keyType, restriction) ++} ++ ++//sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL ++//sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL ++ + func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { + var msg Msghdr + var rsa RawSockaddrAny +@@ -926,22 +1324,24 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from + msg.Namelen = uint32(SizeofSockaddrAny) + var iov Iovec + if len(p) > 0 { +- iov.Base = (*byte)(unsafe.Pointer(&p[0])) ++ iov.Base = &p[0] + iov.SetLen(len(p)) + } + var dummy byte + if len(oob) > 0 { +- var sockType int +- sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) +- if err != nil { +- return ++ if len(p) == 0 { ++ var sockType int ++ sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) ++ if err != nil { ++ return ++ } ++ // receive at least one normal byte ++ if sockType != SOCK_DGRAM { ++ iov.Base = &dummy ++ iov.SetLen(1) ++ } + } +- // receive at least one normal byte +- if sockType != SOCK_DGRAM && len(p) == 0 { +- iov.Base = &dummy +- iov.SetLen(1) +- } +- msg.Control = (*byte)(unsafe.Pointer(&oob[0])) ++ msg.Control = &oob[0] + msg.SetControllen(len(oob)) + } + msg.Iov = &iov +@@ -953,7 +1353,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 + } +@@ -974,26 +1374,28 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) + } + } + var msg Msghdr +- msg.Name = (*byte)(unsafe.Pointer(ptr)) ++ msg.Name = (*byte)(ptr) + msg.Namelen = uint32(salen) + var iov Iovec + if len(p) > 0 { +- iov.Base = (*byte)(unsafe.Pointer(&p[0])) ++ iov.Base = &p[0] + iov.SetLen(len(p)) + } + var dummy byte + if len(oob) > 0 { +- var sockType int +- sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) +- if err != nil { +- return 0, err ++ if len(p) == 0 { ++ var sockType int ++ sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) ++ if err != nil { ++ return 0, err ++ } ++ // send at least one normal byte ++ if sockType != SOCK_DGRAM { ++ iov.Base = &dummy ++ iov.SetLen(1) ++ } + } +- // send at least one normal byte +- if sockType != SOCK_DGRAM && len(p) == 0 { +- iov.Base = &dummy +- iov.SetLen(1) +- } +- msg.Control = (*byte)(unsafe.Pointer(&oob[0])) ++ msg.Control = &oob[0] + msg.SetControllen(len(oob)) + } + msg.Iov = &iov +@@ -1021,20 +1423,20 @@ 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 ++ // Leading edge. PEEKTEXT/PEEKDATA don't require aligned + // access (PEEKUSER warns that it might), but if we don't + // align our reads, we might straddle an unmapped page + // 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:] + } + +@@ -1072,15 +1474,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 + } +@@ -1088,19 +1490,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 +@@ -1125,6 +1527,10 @@ func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) { + return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data) + } + ++func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) { ++ return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data) ++} ++ + func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) { + return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) + } +@@ -1154,8 +1560,12 @@ func PtraceSyscall(pid int, signal int) (err error) { + + func PtraceSingleStep(pid int) (err error) { return ptrace(PTRACE_SINGLESTEP, pid, 0, 0) } + ++func PtraceInterrupt(pid int) (err error) { return ptrace(PTRACE_INTERRUPT, pid, 0, 0) } ++ + func PtraceAttach(pid int) (err error) { return ptrace(PTRACE_ATTACH, pid, 0, 0) } + ++func PtraceSeize(pid int) (err error) { return ptrace(PTRACE_SEIZE, pid, 0, 0) } ++ + func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0) } + + //sys reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) +@@ -1164,10 +1574,6 @@ func Reboot(cmd int) (err error) { + return reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, "") + } + +-func ReadDirent(fd int, buf []byte) (n int, err error) { +- return Getdents(fd, buf) +-} +- + func direntIno(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) + } +@@ -1199,6 +1605,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 +@@ -1209,26 +1622,33 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri + //sys Acct(path string) (err error) + //sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) + //sys Adjtimex(buf *Timex) (state int, err error) ++//sysnb Capget(hdr *CapUserHeader, data *CapUserData) (err error) ++//sysnb Capset(hdr *CapUserHeader, data *CapUserData) (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 ClockNanosleep(clockid int32, flags int, request *Timespec, remain *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 EpollCreate(size int) (fd int, err error) + //sysnb EpollCreate1(flag int) (fd int, err error) + //sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) + //sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2 + //sys Exit(code int) = SYS_EXIT_GROUP +-//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) + //sys Fallocate(fd int, mode uint32, off int64, len int64) (err error) + //sys Fchdir(fd int) (err error) + //sys Fchmod(fd int, mode uint32) (err error) + //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) +@@ -1246,6 +1666,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) +@@ -1256,15 +1677,18 @@ 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) ++//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) + //sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT + //sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64 + //sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) ++//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6 + //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) +@@ -1273,6 +1697,17 @@ func Getpgrp() (pid int) { + //sysnb Settimeofday(tv *Timeval) (err error) + //sys Setns(fd int, nstype int) (err error) + ++// PrctlRetInt performs a prctl operation specified by option and further ++// optional arguments arg2 through arg5 depending on option. It returns a ++// non-negative integer that is returned by the prctl syscall. ++func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (int, error) { ++ ret, _, err := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ++ if err != 0 { ++ return 0, err ++ } ++ return int(ret), nil ++} ++ + // issue 1435. + // On linux Setuid and Setgid only affects the current thread, not the process. + // This does not match what most callers expect so we must return an error +@@ -1286,8 +1721,38 @@ func Setgid(uid int) (err error) { + return EOPNOTSUPP + } + ++// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set. ++// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability. ++// If the call fails due to other reasons, current fsgid will be returned. ++func SetfsgidRetGid(gid int) (int, error) { ++ return setfsgid(gid) ++} ++ ++// SetfsuidRetUid sets fsuid for current thread and returns previous fsuid set. ++// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability ++// If the call fails due to other reasons, current fsuid will be returned. ++func SetfsuidRetUid(uid int) (int, error) { ++ return setfsuid(uid) ++} ++ ++func Setfsgid(gid int) error { ++ _, err := setfsgid(gid) ++ return err ++} ++ ++func Setfsuid(uid int) error { ++ _, err := setfsuid(uid) ++ return err ++} ++ ++func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { ++ return signalfd(fd, sigmask, _C__NSIG/8, flags) ++} ++ + //sys Setpriority(which int, who int, prio int) (err error) + //sys Setxattr(path string, attr string, data []byte, flags int) (err error) ++//sys signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) = SYS_SIGNALFD4 ++//sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) + //sys Sync() + //sys Syncfs(fd int) (err error) + //sysnb Sysinfo(info *Sysinfo_t) (err error) +@@ -1298,11 +1763,127 @@ func Setgid(uid int) (err error) { + //sysnb Uname(buf *Utsname) (err error) + //sys Unmount(target string, flags int) (err error) = SYS_UMOUNT2 + //sys Unshare(flags int) (err error) +-//sys Ustat(dev int, ubuf *Ustat_t) (err error) + //sys write(fd int, p []byte) (n int, err error) + //sys exitThread(code int) (err error) = SYS_EXIT + //sys readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ + //sys writelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE ++//sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV ++//sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV ++//sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV ++//sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV ++//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 ++//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 ++ ++func bytes2iovec(bs [][]byte) []Iovec { ++ iovecs := make([]Iovec, len(bs)) ++ for i, b := range bs { ++ iovecs[i].SetLen(len(b)) ++ if len(b) > 0 { ++ iovecs[i].Base = &b[0] ++ } else { ++ iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero)) ++ } ++ } ++ return iovecs ++} ++ ++// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit ++// systems, hi will always be 0. On 32-bit systems, offs will be split in half. ++// preadv/pwritev chose this calling convention so they don't need to add a ++// padding-register for alignment on ARM. ++func offs2lohi(offs int64) (lo, hi uintptr) { ++ return uintptr(offs), uintptr(uint64(offs) >> SizeofLong) ++} ++ ++func Readv(fd int, iovs [][]byte) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ n, err = readv(fd, iovecs) ++ readvRacedetect(iovecs, n, err) ++ return n, err ++} ++ ++func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ lo, hi := offs2lohi(offset) ++ n, err = preadv(fd, iovecs, lo, hi) ++ readvRacedetect(iovecs, n, err) ++ return n, err ++} ++ ++func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ lo, hi := offs2lohi(offset) ++ n, err = preadv2(fd, iovecs, lo, hi, flags) ++ readvRacedetect(iovecs, n, err) ++ return n, err ++} ++ ++func readvRacedetect(iovecs []Iovec, n int, err error) { ++ if !raceenabled { ++ return ++ } ++ for i := 0; n > 0 && i < len(iovecs); i++ { ++ m := int(iovecs[i].Len) ++ if m > n { ++ m = n ++ } ++ n -= m ++ if m > 0 { ++ raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) ++ } ++ } ++ if err == nil { ++ raceAcquire(unsafe.Pointer(&ioSync)) ++ } ++} ++ ++func Writev(fd int, iovs [][]byte) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ if raceenabled { ++ raceReleaseMerge(unsafe.Pointer(&ioSync)) ++ } ++ n, err = writev(fd, iovecs) ++ writevRacedetect(iovecs, n) ++ return n, err ++} ++ ++func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ if raceenabled { ++ raceReleaseMerge(unsafe.Pointer(&ioSync)) ++ } ++ lo, hi := offs2lohi(offset) ++ n, err = pwritev(fd, iovecs, lo, hi) ++ writevRacedetect(iovecs, n) ++ return n, err ++} ++ ++func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { ++ iovecs := bytes2iovec(iovs) ++ if raceenabled { ++ raceReleaseMerge(unsafe.Pointer(&ioSync)) ++ } ++ lo, hi := offs2lohi(offset) ++ n, err = pwritev2(fd, iovecs, lo, hi, flags) ++ writevRacedetect(iovecs, n) ++ return n, err ++} ++ ++func writevRacedetect(iovecs []Iovec, n int) { ++ if !raceenabled { ++ return ++ } ++ for i := 0; n > 0 && i < len(iovecs); i++ { ++ m := int(iovecs[i].Len) ++ if m > n { ++ m = n ++ } ++ n -= m ++ if m > 0 { ++ raceReadRange(unsafe.Pointer(iovecs[i].Base), m) ++ } ++ } ++} + + // mmap varies by architecture; see syscall_linux_*.go. + //sys munmap(addr uintptr, length uintptr) (err error) +@@ -1332,15 +1913,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) + } +@@ -1348,6 +1926,164 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { + return int(n), nil + } + ++//sys faccessat(dirfd int, path string, mode uint32) (err error) ++ ++func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { ++ if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 { ++ return EINVAL ++ } ++ ++ // 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 ++} ++ ++//sys nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) = SYS_NAME_TO_HANDLE_AT ++//sys openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) = SYS_OPEN_BY_HANDLE_AT ++ ++// fileHandle is the argument to nameToHandleAt and openByHandleAt. We ++// originally tried to generate it via unix/linux/types.go with "type ++// fileHandle C.struct_file_handle" but that generated empty structs ++// for mips64 and mips64le. Instead, hard code it for now (it's the ++// same everywhere else) until the mips64 generator issue is fixed. ++type fileHandle struct { ++ Bytes uint32 ++ Type int32 ++} ++ ++// FileHandle represents the C struct file_handle used by ++// name_to_handle_at (see NameToHandleAt) and open_by_handle_at (see ++// OpenByHandleAt). ++type FileHandle struct { ++ *fileHandle ++} ++ ++// NewFileHandle constructs a FileHandle. ++func NewFileHandle(handleType int32, handle []byte) FileHandle { ++ const hdrSize = unsafe.Sizeof(fileHandle{}) ++ buf := make([]byte, hdrSize+uintptr(len(handle))) ++ copy(buf[hdrSize:], handle) ++ fh := (*fileHandle)(unsafe.Pointer(&buf[0])) ++ fh.Type = handleType ++ fh.Bytes = uint32(len(handle)) ++ return FileHandle{fh} ++} ++ ++func (fh *FileHandle) Size() int { return int(fh.fileHandle.Bytes) } ++func (fh *FileHandle) Type() int32 { return fh.fileHandle.Type } ++func (fh *FileHandle) Bytes() []byte { ++ n := fh.Size() ++ if n == 0 { ++ return nil ++ } ++ return (*[1 << 30]byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type)) + 4))[:n:n] ++} ++ ++// NameToHandleAt wraps the name_to_handle_at system call; it obtains ++// a handle for a path name. ++func NameToHandleAt(dirfd int, path string, flags int) (handle FileHandle, mountID int, err error) { ++ var mid _C_int ++ // Try first with a small buffer, assuming the handle will ++ // only be 32 bytes. ++ size := uint32(32 + unsafe.Sizeof(fileHandle{})) ++ didResize := false ++ for { ++ buf := make([]byte, size) ++ fh := (*fileHandle)(unsafe.Pointer(&buf[0])) ++ fh.Bytes = size - uint32(unsafe.Sizeof(fileHandle{})) ++ err = nameToHandleAt(dirfd, path, fh, &mid, flags) ++ if err == EOVERFLOW { ++ if didResize { ++ // We shouldn't need to resize more than once ++ return ++ } ++ didResize = true ++ size = fh.Bytes + uint32(unsafe.Sizeof(fileHandle{})) ++ continue ++ } ++ if err != nil { ++ return ++ } ++ return FileHandle{fh}, int(mid), nil ++ } ++} ++ ++// OpenByHandleAt wraps the open_by_handle_at system call; it opens a ++// file via a handle as previously returned by NameToHandleAt. ++func OpenByHandleAt(mountFD int, handle FileHandle, flags int) (fd int, err error) { ++ return openByHandleAt(mountFD, handle.fileHandle, flags) ++} ++ ++// Klogset wraps the sys_syslog system call; it sets console_loglevel to ++// the value specified by arg and passes a dummy pointer to bufp. ++func Klogset(typ int, arg int) (err error) { ++ var p unsafe.Pointer ++ _, _, errno := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(p), uintptr(arg)) ++ if errno != 0 { ++ return errnoErr(errno) ++ } ++ return nil ++} ++ + /* + * Unimplemented + */ +@@ -1355,23 +2091,14 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { + // Alarm + // ArchPrctl + // Brk +-// Capget +-// Capset +-// ClockGetres + // ClockNanosleep + // ClockSettime + // Clone +-// CreateModule +-// DeleteModule + // EpollCtlOld + // EpollPwait + // EpollWaitOld + // Execve +-// Fgetxattr +-// Flistxattr + // Fork +-// Fremovexattr +-// Fsetxattr + // Futex + // GetKernelSyms + // GetMempolicy +@@ -1405,13 +2132,11 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { + // Msgget + // Msgrcv + // Msgsnd +-// Newfstatat + // Nfsservctl + // Personality + // Pselect6 + // Ptrace + // Putpmsg +-// QueryModule + // Quotactl + // Readahead + // Readv +@@ -1426,11 +2151,9 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { + // RtSigtimedwait + // SchedGetPriorityMax + // SchedGetPriorityMin +-// SchedGetaffinity + // SchedGetparam + // SchedGetscheduler + // SchedRrGetInterval +-// SchedSetaffinity + // SchedSetparam + // SchedYield + // Security +@@ -1447,7 +2170,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { + // Shmdt + // Shmget + // Sigaltstack +-// Signalfd + // Swapoff + // Swapon + // Sysfs +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go +index 2b881b97..a8374b67 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go +@@ -10,25 +10,15 @@ + package unix + + import ( +- "syscall" + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int32(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: int32(sec), Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = int32(nsec / 1e9) +- tv.Usec = int32(nsec % 1e9 / 1e3) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: int32(sec), Usec: int32(usec)} + } + + //sysnb pipe(p *[2]_C_int) (err error) +@@ -60,9 +50,12 @@ func Pipe2(p []int, flags int) (err error) { + // 64-bit file system and 32-bit uid calls + // (386 default is 32-bit file system and 16-bit uid). + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) ++//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64 + //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 + //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 ++//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 + //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 + //sysnb Getegid() (egid int) = SYS_GETEGID32 + //sysnb Geteuid() (euid int) = SYS_GETEUID32 +@@ -75,9 +68,10 @@ func Pipe2(p []int, flags int) (err error) { + //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 +-//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32 +-//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32 ++//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 ++//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 + //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 + //sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 +@@ -86,12 +80,12 @@ func Pipe2(p []int, flags int) (err error) { + //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 ++//sys Ustat(dev int, ubuf *Ustat_t) (err error) + //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) = SYS_GETGROUPS32 + //sysnb setgroups(n int, list *_Gid_t) (err error) = SYS_SETGROUPS32 + //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT + + //sys mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) +-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Pause() (err error) + + func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { +@@ -165,10 +159,6 @@ func Setrlimit(resource int, rlim *Rlimit) (err error) { + return setrlimit(resource, &rl) + } + +-// Underlying system call writes to newoffset via pointer. +-// Implemented in assembly to avoid allocation. +-func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) +- + func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + newoffset, errno := seek(fd, offset, whence) + if errno != 0 { +@@ -177,17 +167,17 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + return newoffset, nil + } + +-// Vsyscalls on amd64. ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) + //sysnb Time(t *Time_t) (tt Time_t, err error) +- + //sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + + // On x86 Linux, all the socket calls go through an extra indirection, + // I think because the 5-register system call interface can't handle +-// the 6-argument calls like sendto and recvfrom. Instead the ++// the 6-argument calls like sendto and recvfrom. Instead the + // arguments to the underlying system call are the number below +-// and a pointer to an array of uintptr. We hide the pointer in the ++// and a pointer to an array of uintptr. We hide the pointer in the + // socketcall assembly to avoid allocation on every system call. + + const ( +@@ -214,9 +204,6 @@ const ( + _SENDMMSG = 20 + ) + +-func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) +-func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) +- + func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + fd, e := socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) + if e != 0 { +@@ -385,6 +372,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +index 9516a3fd..8ed1d546 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +@@ -7,10 +7,12 @@ + package unix + + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) + //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 + //sys Fchown(fd int, uid int, gid int) (err error) + //sys Fstat(fd int, stat *Stat_t) (err error) ++//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) +@@ -18,20 +20,43 @@ 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 ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) ++ ++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) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -39,10 +64,16 @@ package unix + //sysnb Setreuid(ruid int, euid int) (err error) + //sys Shutdown(fd int, how int) (err error) + //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) +-//sys Stat(path string, stat *Stat_t) (err error) ++ ++func Stat(path string, stat *Stat_t) (err error) { ++ // Use fstatat, because Android's seccomp policy blocks stat. ++ return Fstatat(AT_FDCWD, path, stat, 0) ++} ++ + //sys Statfs(path string, buf *Statfs_t) (err error) + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) ++//sys Ustat(dev int, ubuf *Ustat_t) (err error) + //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) + //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) + //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +@@ -61,6 +92,8 @@ package unix + //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) + ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) ++ + func Gettimeofday(tv *Timeval) (err error) { + errno := gettimeofday(tv) + if errno != 0 { +@@ -69,8 +102,6 @@ func Gettimeofday(tv *Timeval) (err error) { + return nil + } + +-func Getpagesize() int { return 4096 } +- + func Time(t *Time_t) (tt Time_t, err error) { + var tv Timeval + errno := gettimeofday(&tv) +@@ -84,20 +115,14 @@ func Time(t *Time_t) (tt Time_t, err error) { + } + + //sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = nsec % 1e9 / 1e3 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + //sysnb pipe(p *[2]_C_int) (err error) +@@ -138,6 +163,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } +@@ -150,3 +179,16 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { + } + return poll(&fds[0], len(fds), timeout) + } ++ ++//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) ++ ++func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { ++ cmdlineLen := len(cmdline) ++ if cmdlineLen > 0 { ++ // Account for the additional NULL byte added by ++ // BytePtrFromString in kexecFileLoad. The kexec_file_load ++ // syscall expects a NULL-terminated string. ++ cmdlineLen++ ++ } ++ return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +index 71d87022..99ae6137 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +@@ -11,29 +11,26 @@ import ( + "unsafe" + ) + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int32(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: int32(sec), Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = int32(nsec / 1e9) +- tv.Usec = int32(nsec % 1e9 / 1e3) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: int32(sec), Usec: int32(usec)} + } + ++//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 ++ // Try pipe2 first for Android O, then try pipe for kernel 2.6.23. + err = pipe2(&pp, 0) ++ if err == ENOSYS { ++ err = pipe(&pp) ++ } + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +@@ -84,8 +81,11 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + // 64-bit file system and 32-bit uid calls + // (16-bit uid calls are not always supported in newer kernels) + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) ++//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 + //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 ++//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 + //sysnb Getegid() (egid int) = SYS_GETEGID32 + //sysnb Geteuid() (euid int) = SYS_GETEUID32 + //sysnb Getgid() (gid int) = SYS_GETGID32 +@@ -94,10 +94,12 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + //sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32 + //sys Listen(s int, n int) (err error) + //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 ++//sys Pause() (err error) ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 + //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT +-//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32 +-//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32 ++//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 ++//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 + //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 + //sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 +@@ -105,11 +107,10 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + //sys Shutdown(fd int, how int) (err error) + //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) + //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 ++//sys Ustat(dev int, ubuf *Ustat_t) (err error) + +-// Vsyscalls on amd64. ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) +-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) +-//sys Pause() (err error) + + func Time(t *Time_t) (Time_t, error) { + var tv Timeval +@@ -131,6 +132,8 @@ func Utime(path string, buf *Utimbuf) error { + return Utimes(path, tv) + } + ++//sys utimes(path string, times *[2]Timeval) (err error) ++ + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 + //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 +@@ -249,6 +252,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +@@ -261,3 +268,24 @@ 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) ++} ++ ++//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) ++ ++func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { ++ cmdlineLen := len(cmdline) ++ if cmdlineLen > 0 { ++ // Account for the additional NULL byte added by ++ // BytePtrFromString in kexecFileLoad. The kexec_file_load ++ // syscall expects a NULL-terminated string. ++ cmdlineLen++ ++ } ++ return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +index 4a136396..807a0b20 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +@@ -6,7 +6,17 @@ + + 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) +@@ -20,11 +30,20 @@ package unix + //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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6 ++ ++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) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -48,6 +67,11 @@ func Lstat(path string, stat *Stat_t) (err error) { + //sys Statfs(path string, buf *Statfs_t) (err error) + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) ++ ++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) +@@ -66,23 +90,26 @@ func Lstat(path string, stat *Stat_t) (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) + +-func Getpagesize() int { return 65536 } +- + //sysnb Gettimeofday(tv *Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} ++} + +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = nsec % 1e9 / 1e3 +- return ++func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { ++ if tv == nil { ++ return utimensat(dirfd, path, nil, 0) ++ } ++ ++ ts := []Timespec{ ++ NsecToTimespec(TimevalToNsec(tv[0])), ++ NsecToTimespec(TimevalToNsec(tv[1])), ++ } ++ return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) + } + + func Time(t *Time_t) (Time_t, error) { +@@ -105,6 +132,18 @@ func Utime(path string, buf *Utimbuf) error { + 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 +@@ -141,6 +180,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } +@@ -153,30 +196,11 @@ 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 + } + +-// TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove +-// these when the deprecated syscalls that the syscall package relies on +-// are removed. +-const ( +- SYS_GETPGRP = 1060 +- SYS_UTIMES = 1037 +- SYS_FUTIMESAT = 1066 +- SYS_PAUSE = 1061 +- SYS_USTAT = 1070 +- SYS_UTIME = 1063 +- SYS_LCHOWN = 1032 +- SYS_TIME = 1062 +- SYS_EPOLL_CREATE = 1042 +- SYS_EPOLL_WAIT = 1069 +-) +- + func Poll(fds []PollFd, timeout int) (n int, err error) { + var ts *Timespec + if timeout >= 0 { +@@ -188,3 +212,16 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { + } + return ppoll(&fds[0], len(fds), ts, nil) + } ++ ++//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) ++ ++func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { ++ cmdlineLen := len(cmdline) ++ if cmdlineLen > 0 { ++ // Account for the additional NULL byte added by ++ // BytePtrFromString in kexecFileLoad. The kexec_file_load ++ // syscall expects a NULL-terminated string. ++ cmdlineLen++ ++ } ++ return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go +new file mode 100644 +index 00000000..c26e6ec2 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go +@@ -0,0 +1,14 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build linux,!gccgo ++ ++package unix ++ ++// SyscallNoError may be used instead of Syscall for syscalls that don't fail. ++func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) ++ ++// RawSyscallNoError may be used instead of RawSyscall for syscalls that don't ++// fail. ++func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +new file mode 100644 +index 00000000..070bd389 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +@@ -0,0 +1,16 @@ ++// Copyright 2018 The Go 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,!gccgo,386 ++ ++package unix ++ ++import "syscall" ++ ++// Underlying system call writes to newoffset via pointer. ++// Implemented in assembly to avoid allocation. ++func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) ++ ++func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) ++func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +new file mode 100644 +index 00000000..308eb7ae +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +@@ -0,0 +1,30 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build linux,gccgo,386 ++ ++package unix ++ ++import ( ++ "syscall" ++ "unsafe" ++) ++ ++func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { ++ var newoffset int64 ++ offsetLow := uint32(offset & 0xffffffff) ++ offsetHigh := uint32((offset >> 32) & 0xffffffff) ++ _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) ++ return newoffset, err ++} ++ ++func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { ++ fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) ++ return int(fd), err ++} ++ ++func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { ++ fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) ++ return int(fd), err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +new file mode 100644 +index 00000000..aa7fc9e1 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +@@ -0,0 +1,20 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build linux,gccgo,arm ++ ++package unix ++ ++import ( ++ "syscall" ++ "unsafe" ++) ++ ++func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { ++ var newoffset int64 ++ offsetLow := uint32(offset & 0xffffffff) ++ offsetHigh := uint32((offset >> 32) & 0xffffffff) ++ _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) ++ return newoffset, err ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +index 73318e5c..af77e6e2 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +@@ -8,7 +8,9 @@ + package unix + + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) + //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) ++//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 + //sys Fchown(fd int, uid int, gid int) (err error) + //sys Fstatfs(fd int, buf *Statfs_t) (err error) + //sys Ftruncate(fd int, length int64) (err error) +@@ -22,11 +24,20 @@ package unix + //sys Pause() (err error) + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6 ++ ++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) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -37,6 +48,7 @@ package unix + //sys Statfs(path string, buf *Statfs_t) (err error) + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) ++//sys Ustat(dev int, ubuf *Ustat_t) (err error) + //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) + //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) + //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +@@ -55,8 +67,7 @@ package unix + //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) + +-func Getpagesize() int { return 65536 } +- ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) + + func Time(t *Time_t) (tt Time_t, err error) { +@@ -72,20 +83,14 @@ func Time(t *Time_t) (tt Time_t, err error) { + } + + //sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = nsec % 1e9 / 1e3 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func Pipe(p []int) (err error) { +@@ -143,6 +148,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) + +@@ -153,6 +159,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) +@@ -195,10 +208,18 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } + ++func InotifyInit() (fd int, err error) { ++ return InotifyInit1(0) ++} ++ + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) + + func Poll(fds []PollFd, timeout int) (n int, err error) { +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +index b83d93fd..e286c6ba 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +@@ -15,6 +15,9 @@ import ( + func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) + + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) ++//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) ++//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 + //sys Fchown(fd int, uid int, gid int) (err error) + //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 + //sysnb Getegid() (egid int) +@@ -25,20 +28,20 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, + //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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT + //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 +-//sys Setfsgid(gid int) (err error) +-//sys Setfsuid(uid int) (err error) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +- + //sysnb Setreuid(ruid int, euid int) (err error) + //sys Shutdown(fd int, how int) (err error) +-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) +- ++//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64 ++//sys Ustat(dev int, ubuf *Ustat_t) (err error) + //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) + //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) + //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +@@ -60,15 +63,17 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, + //sys Ioperm(from int, num int, on int) (err error) + //sys Iopl(level int) (err error) + ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) + //sysnb Time(t *Time_t) (tt Time_t, err error) ++//sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + + //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 + //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 ++//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 + //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 + +-//sys Utime(path string, buf *Utimbuf) (err error) +-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Pause() (err error) + + func Fstatfs(fd int, buf *Statfs_t) (err error) { +@@ -99,19 +104,12 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) { + return + } + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int32(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: int32(sec), Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = int32(nsec / 1e9) +- tv.Usec = int32(nsec % 1e9 / 1e3) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: int32(sec), Usec: int32(usec)} + } + + //sysnb pipe2(p *[2]_C_int, flags int) (err error) +@@ -127,14 +125,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 + } + +@@ -223,6 +220,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +@@ -235,5 +236,3 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { + } + return poll(&fds[0], len(fds), timeout) + } +- +-func Getpagesize() int { return 4096 } +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +index 60770f62..ca0345aa 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +@@ -7,10 +7,13 @@ + + package unix + +-//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) ++//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) ++//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 + //sys Fchown(fd int, uid int, gid int) (err error) + //sys Fstat(fd int, stat *Stat_t) (err error) ++//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) +@@ -27,11 +30,12 @@ package unix + //sys Pause() (err error) + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT + //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) +-//sys Setfsgid(gid int) (err error) +-//sys Setfsuid(uid int) (err error) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -41,8 +45,8 @@ 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) + //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) +@@ -61,26 +65,18 @@ package unix + //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) + +-func Getpagesize() int { return 65536 } +- ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) + //sysnb Time(t *Time_t) (tt Time_t, err error) +- + //sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = nsec % 1e9 / 1e3 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func (r *PtraceRegs) PC() uint64 { return r.Nip } +@@ -95,6 +91,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } +@@ -133,3 +133,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/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +similarity index 68% +copy from vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +copy to vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +index 4a136396..abdabbac 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +@@ -1,12 +1,22 @@ +-// Copyright 2015 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. + +-// +build arm64,linux ++// +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) +@@ -21,10 +31,18 @@ package unix + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK +-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6 ++ ++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) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -48,6 +66,11 @@ func Lstat(path string, stat *Stat_t) (err error) { + //sys Statfs(path string, buf *Statfs_t) (err error) + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) ++ ++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) +@@ -66,23 +89,26 @@ func Lstat(path string, stat *Stat_t) (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) + +-func Getpagesize() int { return 65536 } +- + //sysnb Gettimeofday(tv *Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} ++} + +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = nsec % 1e9 / 1e3 +- return ++func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { ++ if tv == nil { ++ return utimensat(dirfd, path, nil, 0) ++ } ++ ++ ts := []Timespec{ ++ NsecToTimespec(TimevalToNsec(tv[0])), ++ NsecToTimespec(TimevalToNsec(tv[1])), ++ } ++ return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) + } + + func Time(t *Time_t) (Time_t, error) { +@@ -105,6 +131,18 @@ func Utime(path string, buf *Utimbuf) error { + 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 +@@ -141,6 +179,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } +@@ -153,30 +195,11 @@ 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 + } + +-// TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove +-// these when the deprecated syscalls that the syscall package relies on +-// are removed. +-const ( +- SYS_GETPGRP = 1060 +- SYS_UTIMES = 1037 +- SYS_FUTIMESAT = 1066 +- SYS_PAUSE = 1061 +- SYS_USTAT = 1070 +- SYS_UTIME = 1063 +- SYS_LCHOWN = 1032 +- SYS_TIME = 1062 +- SYS_EPOLL_CREATE = 1042 +- SYS_EPOLL_WAIT = 1069 +-) +- + func Poll(fds []PollFd, timeout int) (n int, err error) { + var ts *Timespec + if timeout >= 0 { +@@ -188,3 +211,20 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { + } + return ppoll(&fds[0], len(fds), ts, nil) + } ++ ++func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { ++ return Renameat2(olddirfd, oldpath, newdirfd, newpath, 0) ++} ++ ++//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) ++ ++func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { ++ cmdlineLen := len(cmdline) ++ if cmdlineLen > 0 { ++ // Account for the additional NULL byte added by ++ // BytePtrFromString in kexecFileLoad. The kexec_file_load ++ // syscall expects a NULL-terminated string. ++ cmdlineLen++ ++ } ++ return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +index 1708a4bb..533e9305 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +@@ -11,10 +11,12 @@ import ( + ) + + //sys Dup2(oldfd int, newfd int) (err error) ++//sysnb EpollCreate(size int) (fd int, err error) + //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) + //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 + //sys Fchown(fd int, uid int, gid int) (err error) + //sys Fstat(fd int, stat *Stat_t) (err error) ++//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) +@@ -28,11 +30,12 @@ import ( + //sys Pause() (err error) + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK + //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) +-//sys Setfsgid(gid int) (err error) +-//sys Setfsuid(uid int) (err error) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -43,11 +46,11 @@ import ( + //sys Statfs(path string, buf *Statfs_t) (err error) + //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) + //sys Truncate(path string, length int64) (err error) ++//sys Ustat(dev int, ubuf *Ustat_t) (err error) + //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) + //sysnb setgroups(n int, list *_Gid_t) (err error) + +-func Getpagesize() int { return 4096 } +- ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) + + func Time(t *Time_t) (tt Time_t, err error) { +@@ -63,20 +66,14 @@ func Time(t *Time_t) (tt Time_t, err error) { + } + + //sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = nsec % 1e9 / 1e3 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + //sysnb pipe2(p *[2]_C_int, flags int) (err error) +@@ -123,6 +120,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } +@@ -326,3 +327,16 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { + } + return poll(&fds[0], len(fds), timeout) + } ++ ++//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) ++ ++func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { ++ cmdlineLen := len(cmdline) ++ if cmdlineLen > 0 { ++ // Account for the additional NULL byte added by ++ // BytePtrFromString in kexecFileLoad. The kexec_file_load ++ // syscall expects a NULL-terminated string. ++ cmdlineLen++ ++ } ++ return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +index 20b7454d..d890a227 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +@@ -6,15 +6,12 @@ + + package unix + +-import ( +- "sync/atomic" +- "syscall" +-) +- + //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 Dup2(oldfd int, newfd int) (err error) + //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) = SYS_FSTATAT64 + //sys Fstatfs(fd int, buf *Statfs_t) (err error) + //sys Ftruncate(fd int, length int64) (err error) + //sysnb Getegid() (egid int) +@@ -29,11 +26,12 @@ import ( + //sys Pause() (err error) + //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 + //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 ++//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK + //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) +-//sys Setfsgid(gid int) (err error) +-//sys Setfsuid(uid int) (err error) ++//sys setfsgid(gid int) (prev int, err error) ++//sys setfsuid(uid int) (prev int, err error) + //sysnb Setregid(rgid int, egid int) (err error) + //sysnb Setresgid(rgid int, egid int, sgid int) (err error) + //sysnb Setresuid(ruid int, euid int, suid int) (err error) +@@ -63,21 +61,6 @@ import ( + //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) + +-func sysconf(name int) (n int64, err syscall.Errno) +- +-// pageSize caches the value of Getpagesize, since it can't change +-// once the system is booted. +-var pageSize int64 // accessed atomically +- +-func Getpagesize() int { +- n := atomic.LoadInt64(&pageSize) +- if n == 0 { +- n, _ = sysconf(_SC_PAGESIZE) +- atomic.StoreInt64(&pageSize, n) +- } +- return int(n) +-} +- + func Ioperm(from int, num int, on int) (err error) { + return ENOSYS + } +@@ -86,6 +69,7 @@ func Iopl(level int) (err error) { + return ENOSYS + } + ++//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error) + //sysnb Gettimeofday(tv *Timeval) (err error) + + func Time(t *Time_t) (tt Time_t, err error) { +@@ -101,20 +85,14 @@ func Time(t *Time_t) (tt Time_t, err error) { + } + + //sys Utime(path string, buf *Utimbuf) (err error) ++//sys utimes(path string, times *[2]Timeval) (err error) + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Sec = nsec / 1e9 +- tv.Usec = int32(nsec % 1e9 / 1e3) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func (r *PtraceRegs) PC() uint64 { return r.Tpc } +@@ -129,6 +107,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint64(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go +index e1296684..45b50a61 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go ++++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go +@@ -13,10 +13,12 @@ + package unix + + import ( ++ "runtime" + "syscall" + "unsafe" + ) + ++// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. + type SockaddrDatalink struct { + Len uint8 + Family uint8 +@@ -55,7 +57,6 @@ func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) { + } + + func nametomib(name string) (mib []_C_int, err error) { +- + // Split name into components. + var parts []string + last := 0 +@@ -114,9 +115,47 @@ func Pipe(p []int) (err error) { + return + } + +-//sys getdents(fd int, buf []byte) (n int, err error) ++//sys Getdents(fd int, buf []byte) (n int, err error) + func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { +- return getdents(fd, buf) ++ n, err = Getdents(fd, buf) ++ if err != nil || basep == nil { ++ return ++ } ++ ++ var off int64 ++ off, err = Seek(fd, 0, 1 /* SEEK_CUR */) ++ if err != nil { ++ *basep = ^uintptr(0) ++ return ++ } ++ *basep = uintptr(off) ++ if unsafe.Sizeof(*basep) == 8 { ++ return ++ } ++ if off>>32 != 0 { ++ // We can't stuff the offset back into a uintptr, so any ++ // future calls would be suspect. Generate an error. ++ // EIO is allowed by getdirentries. ++ err = EIO ++ } ++ return ++} ++ ++const ImplementsGetwd = true ++ ++//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD ++ ++func Getwd() (string, error) { ++ var buf [PathMax]byte ++ _, err := Getcwd(buf[0:]) ++ if err != nil { ++ return "", err ++ } ++ n := clen(buf[:]) ++ if n < 1 { ++ return "", EINVAL ++ } ++ return string(buf[:n]), nil + } + + // TODO +@@ -124,6 +163,83 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + return -1, ENOSYS + } + ++func setattrlistTimes(path string, times []Timespec, flags int) error { ++ // used on Darwin for UtimesNano ++ return ENOSYS ++} ++ ++//sys ioctl(fd int, req uint, arg uintptr) (err error) ++ ++//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL ++ ++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) ++ if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ mib = []_C_int{CTL_KERN, KERN_HOSTNAME} ++ n = unsafe.Sizeof(uname.Nodename) ++ if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ mib = []_C_int{CTL_KERN, KERN_OSRELEASE} ++ n = unsafe.Sizeof(uname.Release) ++ if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ mib = []_C_int{CTL_KERN, KERN_VERSION} ++ n = unsafe.Sizeof(uname.Version) ++ if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ // The version might have newlines or tabs in it, convert them to ++ // spaces. ++ for i, b := range uname.Version { ++ if b == '\n' || b == '\t' { ++ if i == len(uname.Version)-1 { ++ uname.Version[i] = 0 ++ } else { ++ uname.Version[i] = ' ' ++ } ++ } ++ } ++ ++ mib = []_C_int{CTL_HW, HW_MACHINE} ++ n = unsafe.Sizeof(uname.Machine) ++ if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ 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) ++} ++ ++func Fstatvfs(fd int, buf *Statvfs_t) (err error) { ++ return Fstatvfs1(fd, buf, ST_WAIT) ++} ++ ++func Statvfs(path string, buf *Statvfs_t) (err error) { ++ return Statvfs1(path, buf, ST_WAIT) ++} ++ + /* + * Exposed directly + */ +@@ -137,14 +253,33 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + //sys Close(fd int) (err error) + //sys Dup(fd int) (nfd int, err error) + //sys Dup2(from int, to int) (err error) ++//sys Dup3(from int, to int, flags 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) + //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) ++//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) ++//sys Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) = SYS_FSTATVFS1 + //sys Fsync(fd int) (err error) + //sys Ftruncate(fd int, length int64) (err error) + //sysnb Getegid() (egid int) +@@ -165,23 +300,30 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + //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 +-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sysnb Setegid(egid int) (err error) + //sysnb Seteuid(euid int) (err error) + //sysnb Setgid(gid int) (err error) +@@ -194,11 +336,14 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + //sysnb Settimeofday(tp *Timeval) (err error) + //sysnb Setuid(uid int) (err error) + //sys Stat(path string, stat *Stat_t) (err error) ++//sys Statvfs1(path string, buf *Statvfs_t, flags int) (err error) = SYS_STATVFS1 + //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) +@@ -225,7 +370,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + // __msync13 + // __ntp_gettime30 + // __posix_chown +-// __posix_fadvise50 + // __posix_fchown + // __posix_lchown + // __posix_rename +@@ -384,7 +528,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + // getitimer + // getvfsstat + // getxattr +-// ioctl + // ktrace + // lchflags + // lchmod +@@ -422,7 +565,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e + // ntp_adjtime + // pmc_control + // pmc_get_info +-// poll + // pollts + // preadv + // profil +diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go +index afaca098..24da8b52 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go ++++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go +@@ -6,21 +6,12 @@ + + package unix + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int64(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -37,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +index a6ff04ce..25a0ac82 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +@@ -6,21 +6,12 @@ + + package unix + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int64(nsec / 1e9) +- ts.Nsec = int64(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -37,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +index 68a6969b..21591ecd 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go ++++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +@@ -6,21 +6,12 @@ + + package unix + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int64(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -37,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +similarity index 50% +copy from vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +copy to vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +index a6ff04ce..80474963 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +@@ -1,26 +1,17 @@ +-// Copyright 2009 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. + +-// +build amd64,netbsd ++// +build arm64,netbsd + + package unix + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int64(nsec / 1e9) +- ts.Nsec = int64(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -37,6 +28,10 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_no_getwd.go b/vendor/golang.org/x/sys/unix/syscall_no_getwd.go +deleted file mode 100644 +index 530792ea..00000000 +--- a/vendor/golang.org/x/sys/unix/syscall_no_getwd.go ++++ /dev/null +@@ -1,11 +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 dragonfly freebsd netbsd openbsd +- +-package unix +- +-const ImplementsGetwd = false +- +-func Getwd() (string, error) { return "", ENOTSUP } +diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go +index 408e6308..a266e92a 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go ++++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go +@@ -13,10 +13,12 @@ + package unix + + import ( ++ "sort" + "syscall" + "unsafe" + ) + ++// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. + type SockaddrDatalink struct { + Len uint8 + Family uint8 +@@ -32,23 +34,11 @@ type SockaddrDatalink struct { + func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) + + func nametomib(name string) (mib []_C_int, err error) { +- +- // Perform lookup via a binary search +- left := 0 +- right := len(sysctlMib) - 1 +- for { +- idx := left + (right-left)/2 +- switch { +- case name == sysctlMib[idx].ctlname: +- return sysctlMib[idx].ctloid, nil +- case name > sysctlMib[idx].ctlname: +- left = idx + 1 +- default: +- right = idx - 1 +- } +- if left > right { +- break +- } ++ i := sort.Search(len(sysctlMib), func(i int) bool { ++ return sysctlMib[i].ctlname >= name ++ }) ++ if i < len(sysctlMib) && sysctlMib[i].ctlname == name { ++ return sysctlMib[i].ctloid, nil + } + return nil, EINVAL + } +@@ -65,21 +55,87 @@ func direntNamlen(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) + } + +-//sysnb pipe(p *[2]_C_int) (err error) ++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 ++} ++ + 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 + } + var pp [2]_C_int +- err = pipe(&pp) ++ err := pipe2(&pp, flags) + p[0] = int(pp[0]) + p[1] = int(pp[1]) +- return ++ return err + } + +-//sys getdents(fd int, buf []byte) (n int, err error) ++//sys Getdents(fd int, buf []byte) (n int, err error) + func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { +- return getdents(fd, buf) ++ n, err = Getdents(fd, buf) ++ if err != nil || basep == nil { ++ return ++ } ++ ++ var off int64 ++ off, err = Seek(fd, 0, 1 /* SEEK_CUR */) ++ if err != nil { ++ *basep = ^uintptr(0) ++ return ++ } ++ *basep = uintptr(off) ++ if unsafe.Sizeof(*basep) == 8 { ++ return ++ } ++ if off>>32 != 0 { ++ // We can't stuff the offset back into a uintptr, so any ++ // future calls would be suspect. Generate an error. ++ // EIO was allowed by getdirentries. ++ err = EIO ++ } ++ return ++} ++ ++const ImplementsGetwd = true ++ ++//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD ++ ++func Getwd() (string, error) { ++ var buf [PathMax]byte ++ _, err := Getcwd(buf[0:]) ++ if err != nil { ++ return "", err ++ } ++ n := clen(buf[:]) ++ if n < 1 { ++ return "", EINVAL ++ } ++ 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 +@@ -102,6 +158,70 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + return + } + ++func setattrlistTimes(path string, times []Timespec, flags int) error { ++ // used on Darwin for UtimesNano ++ return ENOSYS ++} ++ ++//sys ioctl(fd int, req uint, arg uintptr) (err error) ++ ++//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL ++ ++//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) ++ if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ mib = []_C_int{CTL_KERN, KERN_HOSTNAME} ++ n = unsafe.Sizeof(uname.Nodename) ++ if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ mib = []_C_int{CTL_KERN, KERN_OSRELEASE} ++ n = unsafe.Sizeof(uname.Release) ++ if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ mib = []_C_int{CTL_KERN, KERN_VERSION} ++ n = unsafe.Sizeof(uname.Version) ++ if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ // The version might have newlines or tabs in it, convert them to ++ // spaces. ++ for i, b := range uname.Version { ++ if b == '\n' || b == '\t' { ++ if i == len(uname.Version)-1 { ++ uname.Version[i] = 0 ++ } else { ++ uname.Version[i] = ' ' ++ } ++ } ++ } ++ ++ mib = []_C_int{CTL_HW, HW_MACHINE} ++ n = unsafe.Sizeof(uname.Machine) ++ if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil { ++ return err ++ } ++ ++ return nil ++} ++ + /* + * Exposed directly + */ +@@ -115,14 +235,19 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + //sys Close(fd int) (err error) + //sys Dup(fd int) (nfd int, err error) + //sys Dup2(from int, to int) (err error) ++//sys Dup3(from int, to int, flags 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) ++//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) + //sys Fstatfs(fd int, stat *Statfs_t) (err error) + //sys Fsync(fd int) (err error) + //sys Ftruncate(fd int, length int64) (err error) +@@ -135,6 +260,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + //sysnb Getppid() (ppid int) + //sys Getpriority(which int, who int) (prio int, err error) + //sysnb Getrlimit(which int, lim *Rlimit) (err error) ++//sysnb Getrtable() (rtable int, err error) + //sysnb Getrusage(who int, rusage *Rusage) (err error) + //sysnb Getsid(pid int) (sid int, err error) + //sysnb Gettimeofday(tv *Timeval) (err error) +@@ -144,23 +270,30 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err 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 +-//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sysnb Setegid(egid int) (err error) + //sysnb Seteuid(euid int) (err error) + //sysnb Setgid(gid int) (err error) +@@ -172,16 +305,19 @@ func Getfsstat(buf []Statfs_t, flags int) (n 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(which int, lim *Rlimit) (err error) ++//sysnb Setrtable(rtable int) (err error) + //sysnb Setsid() (pid int, err error) + //sysnb Settimeofday(tp *Timeval) (err error) + //sysnb Setuid(uid int) (err error) + //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) +@@ -204,15 +340,10 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // clock_settime + // closefrom + // execve +-// faccessat +-// fchmodat +-// fchownat +-// fcntl + // fhopen + // fhstat + // fhstatfs + // fork +-// fstatat + // futimens + // getfh + // getgid +@@ -220,20 +351,14 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // getlogin + // getresgid + // getresuid +-// getrtable + // getthrid +-// ioctl + // ktrace + // lfs_bmapv + // lfs_markv + // lfs_segclean + // lfs_segwait +-// linkat + // mincore + // minherit +-// mkdirat +-// mkfifoat +-// mknodat + // mount + // mquery + // msgctl +@@ -242,13 +367,10 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // msgsnd + // nfssvc + // nnpfspioctl +-// openat +-// poll + // preadv + // profil + // pwritev + // quotactl +-// readlinkat + // readv + // reboot + // renameat +@@ -258,7 +380,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // semop + // setgroups + // setitimer +-// setrtable + // setsockopt + // shmat + // shmctl +@@ -270,13 +391,11 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { + // sigprocmask + // sigreturn + // sigsuspend +-// symlinkat + // sysarch + // syscall + // threxit + // thrsigdivert + // thrsleep + // thrwakeup +-// unlinkat + // vfork + // writev +diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go +index a66ddc59..42b5a0e5 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go ++++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go +@@ -6,21 +6,12 @@ + + package unix + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int64(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -37,6 +28,14 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } ++ ++// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions ++// of openbsd/386 the syscall is called sysctl instead of __sysctl. ++const SYS___SYSCTL = SYS_SYSCTL +diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +index 0776c1fa..6ea4b488 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +@@ -6,21 +6,12 @@ + + package unix + +-func Getpagesize() int { return 4096 } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = nsec % 1e9 / 1e3 +- tv.Sec = nsec / 1e9 +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -37,6 +28,14 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } ++ ++// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions ++// of openbsd/amd64 the syscall is called sysctl instead of __sysctl. ++const SYS___SYSCTL = SYS_SYSCTL +diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +index 14ddaf3f..1c3d26fa 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go ++++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +@@ -6,23 +6,12 @@ + + package unix + +-import "syscall" +- +-func Getpagesize() int { return syscall.Getpagesize() } +- +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = int64(nsec / 1e9) +- ts.Nsec = int32(nsec % 1e9) +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: int32(nsec)} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = int32(nsec % 1e9 / 1e3) +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: int32(usec)} + } + + func SetKevent(k *Kevent_t, fd, mode, flags int) { +@@ -39,6 +28,14 @@ func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) + } + ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ + func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) + } ++ ++// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions ++// of openbsd/arm the syscall is called sysctl instead of __sysctl. ++const SYS___SYSCTL = SYS_SYSCTL +diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +new file mode 100644 +index 00000000..a8c458cb +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +@@ -0,0 +1,41 @@ ++// 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. ++ ++// +build arm64,openbsd ++ ++package unix ++ ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} ++} ++ ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} ++} ++ ++func SetKevent(k *Kevent_t, fd, mode, flags int) { ++ k.Ident = uint64(fd) ++ k.Filter = int16(mode) ++ k.Flags = uint16(flags) ++} ++ ++func (iov *Iovec) SetLen(length int) { ++ iov.Len = uint64(length) ++} ++ ++func (msghdr *Msghdr) SetControllen(length int) { ++ msghdr.Controllen = uint32(length) ++} ++ ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = uint32(length) ++} ++ ++func (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) ++} ++ ++// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions ++// of openbsd/amd64 the syscall is called sysctl instead of __sysctl. ++const SYS___SYSCTL = SYS_SYSCTL +diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go +index 0d4e5c4e..0e2a696a 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go ++++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go +@@ -13,7 +13,6 @@ + package unix + + import ( +- "sync/atomic" + "syscall" + "unsafe" + ) +@@ -24,6 +23,7 @@ type syscallFunc uintptr + func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) + func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) + ++// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. + type SockaddrDatalink struct { + Family uint16 + Index uint16 +@@ -35,15 +35,6 @@ type SockaddrDatalink struct { + raw RawSockaddrDatalink + } + +-func clen(n []byte) int { +- for i := 0; i < len(n); i++ { +- if n[i] == 0 { +- return i +- } +- } +- return len(n) +-} +- + func direntIno(buf []byte) (uint64, bool) { + return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino)) + } +@@ -137,7 +128,19 @@ 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 ++// socket associated with fd at the given socket level. ++func GetsockoptString(fd, level, opt int) (string, error) { ++ buf := make([]byte, 256) ++ vallen := _Socklen(len(buf)) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen) ++ if err != nil { ++ return "", err ++ } ++ return string(buf[:vallen-1]), nil + } + + const ImplementsGetwd = true +@@ -167,7 +170,7 @@ func Getwd() (wd string, err error) { + + func Getgroups() (gids []int, err error) { + n, err := getgroups(0, nil) +- // Check for error and sanity check group count. Newer versions of ++ // Check for error and sanity check group count. Newer versions of + // Solaris allow up to 1024 (NGROUPS_MAX). + if n < 0 || n > 1024 { + if err != nil { +@@ -202,6 +205,7 @@ func Setgroups(gids []int) (err error) { + return setgroups(len(a), &a[0]) + } + ++// ReadDirent reads directory entries from fd and writes them into buf. + func ReadDirent(fd int, buf []byte) (n int, err error) { + // Final argument is (basep *uintptr) and the syscall doesn't take nil. + // TODO(rsc): Can we use a single global basep for all calls? +@@ -325,6 +329,16 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { + + //sys fcntl(fd int, cmd int, arg int) (val int, err error) + ++// FcntlInt performs a fcntl syscall on fd with the provided command and argument. ++func FcntlInt(fd uintptr, cmd, arg int) (int, error) { ++ valptr, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0) ++ var err error ++ if errno != 0 { ++ err = errno ++ } ++ return int(valptr), err ++} ++ + // 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 { + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0) +@@ -351,7 +365,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) error { + } + + // Solaris doesn't have an futimes function because it allows NULL to be +-// specified as the path for futimesat. However, Go doesn't like ++// specified as the path for futimesat. However, Go doesn't like + // NULL-style string interfaces, so this simple wrapper is provided. + func Futimes(fd int, tv []Timeval) error { + if tv == nil { +@@ -363,7 +377,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)) +@@ -377,7 +391,7 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { + for n < len(pp.Path) && pp.Path[n] != 0 { + n++ + } +- bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] ++ bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] + sa.Name = string(bytes) + return sa, nil + +@@ -414,7 +428,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 +@@ -451,7 +465,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 + } +@@ -515,50 +529,54 @@ func Acct(path string) (err error) { + return acct(pathp) + } + +-/* +- * Expose the ioctl function +- */ ++//sys __makedev(version int, major uint, minor uint) (val uint64) + +-//sys ioctl(fd int, req uint, arg uintptr) (err error) +- +-func IoctlSetInt(fd int, req uint, value int) (err error) { +- return ioctl(fd, req, uintptr(value)) ++func Mkdev(major, minor uint32) uint64 { ++ return __makedev(NEWDEV, uint(major), uint(minor)) + } + +-func IoctlSetWinsize(fd int, req uint, value *Winsize) (err error) { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++//sys __major(version int, dev uint64) (val uint) ++ ++func Major(dev uint64) uint32 { ++ return uint32(__major(NEWDEV, dev)) + } + +-func IoctlSetTermios(fd int, req uint, value *Termios) (err error) { +- return ioctl(fd, req, uintptr(unsafe.Pointer(value))) ++//sys __minor(version int, dev uint64) (val uint) ++ ++func Minor(dev uint64) uint32 { ++ return uint32(__minor(NEWDEV, dev)) + } + ++/* ++ * Expose the ioctl function ++ */ ++ ++//sys ioctl(fd int, req uint, arg uintptr) (err error) ++ + func IoctlSetTermio(fd int, req uint, value *Termio) (err error) { + return ioctl(fd, req, uintptr(unsafe.Pointer(value))) + } + +-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 ++func IoctlGetTermio(fd int, req uint) (*Termio, error) { ++ var value Termio + 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 ++//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) + } + +-func IoctlGetTermio(fd int, req uint) (*Termio, error) { +- var value Termio +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) +- return &value, err ++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) + } + + /* +@@ -575,15 +593,17 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) { + //sys Dup(fd int) (nfd int, err error) + //sys Dup2(oldfd int, newfd 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 Fchown(fd int, uid int, gid int) (err error) + //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) + //sys Fdatasync(fd int) (err error) +-//sys Flock(fd int, how 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 Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) + //sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) + //sysnb Getgid() (gid int) +@@ -613,6 +633,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) { + //sys Mlock(b []byte) (err error) + //sys Mlockall(flags int) (err error) + //sys Mprotect(b []byte, prot int) (err error) ++//sys Msync(b []byte, flags int) (err error) + //sys Munlock(b []byte) (err error) + //sys Munlockall() (err error) + //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) +@@ -628,6 +649,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) { + //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) + //sys Rmdir(path string) (err error) + //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek ++//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) + //sysnb Setegid(egid int) (err error) + //sysnb Seteuid(euid int) (err error) + //sysnb Setgid(gid int) (err error) +@@ -659,6 +681,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) { + //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect + //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) + //sys munmap(addr uintptr, length uintptr) (err error) ++//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = libsendfile.sendfile + //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto + //sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket + //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair +@@ -699,18 +722,3 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e + func Munmap(b []byte) (err error) { + return mapper.Munmap(b) + } +- +-//sys sysconf(name int) (n int64, err error) +- +-// pageSize caches the value of Getpagesize, since it can't change +-// once the system is booted. +-var pageSize int64 // accessed atomically +- +-func Getpagesize() int { +- n := atomic.LoadInt64(&pageSize) +- if n == 0 { +- n, _ = sysconf(_SC_PAGESIZE) +- atomic.StoreInt64(&pageSize, n) +- } +- return int(n) +-} +diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +index 5aff62c3..b22a34d7 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go ++++ b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +@@ -6,30 +6,22 @@ + + package unix + +-func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } +- +-func NsecToTimespec(nsec int64) (ts Timespec) { +- ts.Sec = nsec / 1e9 +- ts.Nsec = nsec % 1e9 +- return ++func setTimespec(sec, nsec int64) Timespec { ++ return Timespec{Sec: sec, Nsec: nsec} + } + +-func NsecToTimeval(nsec int64) (tv Timeval) { +- nsec += 999 // round up to microsecond +- tv.Usec = nsec % 1e9 / 1e3 +- tv.Sec = int64(nsec / 1e9) +- return ++func setTimeval(sec, usec int64) Timeval { ++ return Timeval{Sec: sec, Usec: usec} + } + + func (iov *Iovec) SetLen(length int) { + iov.Len = uint64(length) + } + +-func (cmsg *Cmsghdr) SetLen(length int) { +- cmsg.Len = uint32(length) ++func (msghdr *Msghdr) SetIovlen(length int) { ++ msghdr.Iovlen = int32(length) + } + +-func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { +- // TODO(aram): implement this, see issue 5847. +- panic("unimplemented") ++func (cmsg *Cmsghdr) SetLen(length int) { ++ cmsg.Len = uint32(length) + } +diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go +index 3ed8a91f..8f710d01 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_unix.go ++++ b/vendor/golang.org/x/sys/unix/syscall_unix.go +@@ -2,12 +2,13 @@ + // 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 ( +- "runtime" ++ "bytes" ++ "sort" + "sync" + "syscall" + "unsafe" +@@ -19,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 ( +@@ -34,6 +28,11 @@ var ( + errENOENT error = syscall.ENOENT + ) + ++var ( ++ signalNameMapOnce sync.Once ++ signalNameMap map[string]syscall.Signal ++) ++ + // errnoErr returns common boxed Errno values, to prevent + // allocations at runtime. + func errnoErr(e syscall.Errno) error { +@@ -50,6 +49,50 @@ func errnoErr(e syscall.Errno) error { + return e + } + ++// ErrnoName returns the error name for error number e. ++func ErrnoName(e syscall.Errno) string { ++ i := sort.Search(len(errorList), func(i int) bool { ++ return errorList[i].num >= e ++ }) ++ if i < len(errorList) && errorList[i].num == e { ++ return errorList[i].name ++ } ++ return "" ++} ++ ++// SignalName returns the signal name for signal number s. ++func SignalName(s syscall.Signal) string { ++ i := sort.Search(len(signalList), func(i int) bool { ++ return signalList[i].num >= s ++ }) ++ if i < len(signalList) && signalList[i].num == s { ++ return signalList[i].name ++ } ++ return "" ++} ++ ++// SignalNum returns the syscall.Signal for signal named s, ++// or 0 if a signal with such name is not found. ++// The signal name should start with "SIG". ++func SignalNum(s string) syscall.Signal { ++ signalNameMapOnce.Do(func() { ++ signalNameMap = make(map[string]syscall.Signal, len(signalList)) ++ for _, signal := range signalList { ++ signalNameMap[signal.name] = signal.num ++ } ++ }) ++ return signalNameMap[s] ++} ++ ++// clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte. ++func clen(n []byte) int { ++ i := bytes.IndexByte(n, 0) ++ if i == -1 { ++ i = len(n) ++ } ++ return i ++} ++ + // Mmap manager, for use by operating system-specific implementations. + + type mmapper struct { +@@ -138,16 +181,19 @@ func Write(fd int, p []byte) (n int, err error) { + // creation of IPv6 sockets to return EAFNOSUPPORT. + var SocketDisableIPv6 bool + ++// Sockaddr represents a socket address. + type Sockaddr interface { + sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs + } + ++// SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets. + type SockaddrInet4 struct { + Port int + Addr [4]byte + raw RawSockaddrInet4 + } + ++// SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets. + type SockaddrInet6 struct { + Port int + ZoneId uint32 +@@ -155,6 +201,7 @@ type SockaddrInet6 struct { + raw RawSockaddrInet6 + } + ++// SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets. + type SockaddrUnix struct { + Name string + raw RawSockaddrUnix +@@ -182,7 +229,14 @@ 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) { ++ var n byte ++ vallen := _Socklen(1) ++ err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) ++ return n, err + } + + func GetsockoptInt(fd, level, opt int) (value int, err error) { +@@ -192,6 +246,61 @@ func GetsockoptInt(fd, level, opt int) (value int, err error) { + return int(n), err + } + ++func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) { ++ vallen := _Socklen(4) ++ err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen) ++ return value, err ++} ++ ++func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) { ++ var value IPMreq ++ vallen := _Socklen(SizeofIPMreq) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) ++ return &value, err ++} ++ ++func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) { ++ var value IPv6Mreq ++ vallen := _Socklen(SizeofIPv6Mreq) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) ++ return &value, err ++} ++ ++func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) { ++ var value IPv6MTUInfo ++ vallen := _Socklen(SizeofIPv6MTUInfo) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) ++ return &value, err ++} ++ ++func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) { ++ var value ICMPv6Filter ++ vallen := _Socklen(SizeofICMPv6Filter) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen) ++ return &value, err ++} ++ ++func GetsockoptLinger(fd, level, opt int) (*Linger, error) { ++ var linger Linger ++ vallen := _Socklen(SizeofLinger) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen) ++ return &linger, err ++} ++ ++func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) { ++ var tv Timeval ++ vallen := _Socklen(unsafe.Sizeof(tv)) ++ err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen) ++ return &tv, err ++} ++ ++func GetsockoptUint64(fd, level, opt int) (value uint64, err error) { ++ var n uint64 ++ vallen := _Socklen(8) ++ err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) ++ return n, err ++} ++ + func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny +@@ -199,7 +308,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 + } +@@ -242,13 +351,21 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (err error) { + } + + func SetsockoptString(fd, level, opt int, s string) (err error) { +- return setsockopt(fd, level, opt, unsafe.Pointer(&[]byte(s)[0]), uintptr(len(s))) ++ var p unsafe.Pointer ++ if len(s) > 0 { ++ p = unsafe.Pointer(&[]byte(s)[0]) ++ } ++ return setsockopt(fd, level, opt, p, uintptr(len(s))) + } + + func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error) { + return setsockopt(fd, level, opt, unsafe.Pointer(tv), unsafe.Sizeof(*tv)) + } + ++func SetsockoptUint64(fd, level, opt int, value uint64) (err error) { ++ return setsockopt(fd, level, opt, unsafe.Pointer(&value), 8) ++} ++ + func Socket(domain, typ, proto int) (fd int, err error) { + if domain == AF_INET6 && SocketDisableIPv6 { + return -1, EAFNOSUPPORT +@@ -267,13 +384,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) } +@@ -291,3 +401,31 @@ func SetNonblock(fd int, nonblocking bool) (err error) { + _, err = fcntl(fd, F_SETFL, flag) + return err + } ++ ++// Exec calls execve(2), which replaces the calling executable in the process ++// tree. argv0 should be the full path to an executable ("/bin/ls") and the ++// executable name should also be the first argument in argv (["ls", "-l"]). ++// envv are the environment variables that should be passed to the new ++// process (["USER=go", "PWD=/tmp"]). ++func Exec(argv0 string, argv []string, envv []string) error { ++ return syscall.Exec(argv0, argv, envv) ++} ++ ++// Lutimes sets the access and modification times tv on path. If path refers to ++// a symlink, it is not dereferenced and the timestamps are set on the symlink. ++// If tv is nil, the access and modification times are set to the current time. ++// Otherwise tv must contain exactly 2 elements, with access time as the first ++// element and modification time as the second element. ++func Lutimes(path string, tv []Timeval) error { ++ if tv == nil { ++ return UtimesNanoAt(AT_FDCWD, path, nil, AT_SYMLINK_NOFOLLOW) ++ } ++ if len(tv) != 2 { ++ return EINVAL ++ } ++ ts := []Timespec{ ++ NsecToTimespec(TimevalToNsec(tv[0])), ++ NsecToTimespec(TimevalToNsec(tv[1])), ++ } ++ return UtimesNanoAt(AT_FDCWD, path, ts, AT_SYMLINK_NOFOLLOW) ++} +diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go +index 4cb8e8ed..1c70d1b6 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go ++++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go +@@ -3,7 +3,7 @@ + // license that can be found in the LICENSE file. + + // +build darwin dragonfly freebsd linux netbsd openbsd solaris +-// +build !gccgo ++// +build !gccgo,!ppc64le,!ppc64 + + package unix + +diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +similarity index 51% +copy from vendor/golang.org/x/sys/unix/syscall_unix_gc.go +copy to vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +index 4cb8e8ed..86dc765a 100644 +--- a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go ++++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +@@ -1,15 +1,24 @@ +-// Copyright 2016 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. + +-// +build darwin dragonfly freebsd linux netbsd openbsd solaris ++// +build linux ++// +build ppc64le ppc64 + // +build !gccgo + + package unix + + import "syscall" + +-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) +-func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) +-func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) +-func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) ++func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { ++ return syscall.Syscall(trap, a1, a2, a3) ++} ++func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { ++ return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) ++} ++func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { ++ return syscall.RawSyscall(trap, a1, a2, a3) ++} ++func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { ++ return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) ++} +diff --git a/vendor/golang.org/x/sys/unix/timestruct.go b/vendor/golang.org/x/sys/unix/timestruct.go +new file mode 100644 +index 00000000..4a672f56 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/timestruct.go +@@ -0,0 +1,82 @@ ++// 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris ++ ++package unix ++ ++import "time" ++ ++// TimespecToNsec converts a Timespec value into a number of ++// nanoseconds since the Unix epoch. ++func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } ++ ++// NsecToTimespec takes a number of nanoseconds since the Unix epoch ++// and returns the corresponding Timespec value. ++func NsecToTimespec(nsec int64) Timespec { ++ sec := nsec / 1e9 ++ nsec = nsec % 1e9 ++ if nsec < 0 { ++ nsec += 1e9 ++ sec-- ++ } ++ return setTimespec(sec, nsec) ++} ++ ++// TimeToTimespec converts t into a Timespec. ++// On some 32-bit systems the range of valid Timespec values are smaller ++// than that of time.Time values. So if t is out of the valid range of ++// Timespec, it returns a zero Timespec and ERANGE. ++func TimeToTimespec(t time.Time) (Timespec, error) { ++ sec := t.Unix() ++ nsec := int64(t.Nanosecond()) ++ ts := setTimespec(sec, nsec) ++ ++ // Currently all targets have either int32 or int64 for Timespec.Sec. ++ // If there were a new target with floating point type for it, we have ++ // to consider the rounding error. ++ if int64(ts.Sec) != sec { ++ return Timespec{}, ERANGE ++ } ++ return ts, nil ++} ++ ++// TimevalToNsec converts a Timeval value into a number of nanoseconds ++// since the Unix epoch. ++func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } ++ ++// NsecToTimeval takes a number of nanoseconds since the Unix epoch ++// and returns the corresponding Timeval value. ++func NsecToTimeval(nsec int64) Timeval { ++ nsec += 999 // round up to microsecond ++ usec := nsec % 1e9 / 1e3 ++ sec := nsec / 1e9 ++ if usec < 0 { ++ usec += 1e6 ++ sec-- ++ } ++ return setTimeval(sec, usec) ++} ++ ++// Unix returns ts as the number of seconds and nanoseconds elapsed since the ++// Unix epoch. ++func (ts *Timespec) Unix() (sec int64, nsec int64) { ++ return int64(ts.Sec), int64(ts.Nsec) ++} ++ ++// Unix returns tv as the number of seconds and nanoseconds elapsed since the ++// Unix epoch. ++func (tv *Timeval) Unix() (sec int64, nsec int64) { ++ return int64(tv.Sec), int64(tv.Usec) * 1000 ++} ++ ++// Nano returns ts as the number of nanoseconds elapsed since the Unix epoch. ++func (ts *Timespec) Nano() int64 { ++ return int64(ts.Sec)*1e9 + int64(ts.Nsec) ++} ++ ++// Nano returns tv as the number of nanoseconds elapsed since the Unix epoch. ++func (tv *Timeval) Nano() int64 { ++ return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 ++} +diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_aix.go +similarity index 53% +copy from vendor/golang.org/x/sys/unix/types_netbsd.go +copy to vendor/golang.org/x/sys/unix/types_aix.go +index cb95c80a..40d2beed 100644 +--- a/vendor/golang.org/x/sys/unix/types_netbsd.go ++++ b/vendor/golang.org/x/sys/unix/types_aix.go +@@ -1,11 +1,12 @@ +-// Copyright 2009 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. + + // +build ignore ++// +build aix + + /* +-Input to cgo -godefs. See README.md ++Input to cgo -godefs. See also mkerrors.sh and mkall.sh + */ + + // +godefs map struct_in_addr [4]byte /* in_addr */ +@@ -14,44 +15,37 @@ Input to cgo -godefs. See README.md + package unix + + /* +-#define KERNEL +-#include <dirent.h> +-#include <fcntl.h> +-#include <signal.h> +-#include <termios.h> +-#include <stdio.h> +-#include <unistd.h> +-#include <sys/param.h> + #include <sys/types.h> +-#include <sys/event.h> +-#include <sys/mman.h> +-#include <sys/mount.h> +-#include <sys/ptrace.h> +-#include <sys/resource.h> +-#include <sys/select.h> +-#include <sys/signal.h> +-#include <sys/socket.h> +-#include <sys/stat.h> +-#include <sys/sysctl.h> + #include <sys/time.h> +-#include <sys/uio.h> ++#include <sys/limits.h> + #include <sys/un.h> +-#include <sys/wait.h> +-#include <net/bpf.h> ++#include <utime.h> ++#include <sys/utsname.h> ++#include <sys/poll.h> ++#include <sys/resource.h> ++#include <sys/stat.h> ++#include <sys/statfs.h> ++#include <sys/termio.h> ++#include <sys/ioctl.h> ++ ++#include <termios.h> ++ + #include <net/if.h> + #include <net/if_dl.h> +-#include <net/route.h> + #include <netinet/in.h> + #include <netinet/icmp6.h> +-#include <netinet/tcp.h> ++ ++ ++#include <dirent.h> ++#include <fcntl.h> + + enum { + sizeofPtr = sizeof(void*), + }; + + union sockaddr_all { +- struct sockaddr s1; // this one gets used for fields +- struct sockaddr_in s2; // these pad it out ++ struct sockaddr s1; // this one gets used for fields ++ struct sockaddr_in s2; // these pad it out + struct sockaddr_in6 s3; + struct sockaddr_un s4; + struct sockaddr_dl s5; +@@ -65,14 +59,15 @@ struct sockaddr_any { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong ++ PathMax = C.PATH_MAX + ) + + // Basic types +@@ -84,32 +79,50 @@ type ( + _C_long_long C.longlong + ) + ++type off64 C.off64_t ++type off C.off_t ++type Mode_t C.mode_t ++ + // Time + + type Timespec C.struct_timespec + + type Timeval C.struct_timeval + ++type Timeval32 C.struct_timeval32 ++ ++type Timex C.struct_timex ++ ++type Time_t C.time_t ++ ++type Tms C.struct_tms ++ ++type Utimbuf C.struct_utimbuf ++ ++type Timezone C.struct_timezone ++ + // Processes + + type Rusage C.struct_rusage + +-type Rlimit C.struct_rlimit ++type Rlimit C.struct_rlimit64 ++ ++type Pid_t C.pid_t + + type _Gid_t C.gid_t + ++type dev_t C.dev_t ++ + // Files + + type Stat_t C.struct_stat + +-type Statfs_t C.struct_statfs ++type StatxTimestamp C.struct_statx_timestamp + +-type Flock_t C.struct_flock ++type Statx_t C.struct_statx + + type Dirent C.struct_dirent + +-type Fsid C.fsid_t +- + // Sockets + + type RawSockaddrInet4 C.struct_sockaddr_in +@@ -126,7 +139,9 @@ type RawSockaddrAny C.struct_sockaddr_any + + type _Socklen C.socklen_t + +-type Linger C.struct_linger ++type Cmsghdr C.struct_cmsghdr ++ ++type ICMPv6Filter C.struct_icmp6_filter + + type Iovec C.struct_iovec + +@@ -134,15 +149,11 @@ type IPMreq C.struct_ip_mreq + + type IPv6Mreq C.struct_ipv6_mreq + +-type Msghdr C.struct_msghdr +- +-type Cmsghdr C.struct_cmsghdr +- +-type Inet6Pktinfo C.struct_in6_pktinfo +- + type IPv6MTUInfo C.struct_ip6_mtuinfo + +-type ICMPv6Filter C.struct_icmp6_filter ++type Linger C.struct_linger ++ ++type Msghdr C.struct_msghdr + + const ( + SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in +@@ -153,87 +164,74 @@ const ( + SizeofLinger = C.sizeof_struct_linger + SizeofIPMreq = C.sizeof_struct_ip_mreq + SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq ++ SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo + SizeofMsghdr = C.sizeof_struct_msghdr + SizeofCmsghdr = C.sizeof_struct_cmsghdr +- SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo +- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo + SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter + ) + +-// Ptrace requests ++// Routing and interface messages + + const ( +- PTRACE_TRACEME = C.PT_TRACE_ME +- PTRACE_CONT = C.PT_CONTINUE +- PTRACE_KILL = C.PT_KILL ++ SizeofIfMsghdr = C.sizeof_struct_if_msghdr + ) + +-// Events (kqueue, kevent) +- +-type Kevent_t C.struct_kevent ++type IfMsgHdr C.struct_if_msghdr + +-// Select ++// Misc + + type FdSet C.fd_set + +-// Routing and interface messages ++type Utsname C.struct_utsname + +-const ( +- SizeofIfMsghdr = C.sizeof_struct_if_msghdr +- SizeofIfData = C.sizeof_struct_if_data +- SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr +- SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr +- SizeofRtMsghdr = C.sizeof_struct_rt_msghdr +- SizeofRtMetrics = C.sizeof_struct_rt_metrics +-) ++type Ustat_t C.struct_ustat + +-type IfMsghdr C.struct_if_msghdr ++type Sigset_t C.sigset_t + +-type IfData C.struct_if_data ++const ( ++ AT_FDCWD = C.AT_FDCWD ++ AT_REMOVEDIR = C.AT_REMOVEDIR ++ AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW ++) + +-type IfaMsghdr C.struct_ifa_msghdr ++// Terminal handling + +-type IfAnnounceMsghdr C.struct_if_announcemsghdr ++type Termios C.struct_termios + +-type RtMsghdr C.struct_rt_msghdr ++type Termio C.struct_termio + +-type RtMetrics C.struct_rt_metrics ++type Winsize C.struct_winsize + +-type Mclpool C.struct_mclpool ++//poll + +-// Berkeley packet filter ++type PollFd struct { ++ Fd int32 ++ Events uint16 ++ Revents uint16 ++} + + const ( +- SizeofBpfVersion = C.sizeof_struct_bpf_version +- SizeofBpfStat = C.sizeof_struct_bpf_stat +- SizeofBpfProgram = C.sizeof_struct_bpf_program +- SizeofBpfInsn = C.sizeof_struct_bpf_insn +- SizeofBpfHdr = C.sizeof_struct_bpf_hdr ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM + ) + +-type BpfVersion C.struct_bpf_version +- +-type BpfStat C.struct_bpf_stat +- +-type BpfProgram C.struct_bpf_program +- +-type BpfInsn C.struct_bpf_insn +- +-type BpfHdr C.struct_bpf_hdr +- +-type BpfTimeval C.struct_bpf_timeval ++//flock_t + +-// Terminal handling +- +-type Termios C.struct_termios ++type Flock_t C.struct_flock64 + +-// fchmodat-like syscalls. ++// Statfs + +-const ( +- AT_FDCWD = C.AT_FDCWD +- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW +-) ++type Fsid_t C.struct_fsid_t ++type Fsid64_t C.struct_fsid64_t + +-// Sysctl ++type Statfs_t C.struct_statfs + +-type Sysctlnode C.struct_sysctlnode ++const RNDGETENTCNT = 0x80045200 +diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go +index 415124d4..155c2e69 100644 +--- a/vendor/golang.org/x/sys/unix/types_darwin.go ++++ b/vendor/golang.org/x/sys/unix/types_darwin.go +@@ -19,6 +19,7 @@ package unix + #define _DARWIN_USE_64_BIT_INODE + #include <dirent.h> + #include <fcntl.h> ++#include <poll.h> + #include <signal.h> + #include <termios.h> + #include <unistd.h> +@@ -38,6 +39,7 @@ package unix + #include <sys/types.h> + #include <sys/uio.h> + #include <sys/un.h> ++#include <sys/utsname.h> + #include <sys/wait.h> + #include <net/bpf.h> + #include <net/if.h> +@@ -68,14 +70,14 @@ struct sockaddr_any { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong + ) + + // Basic types +@@ -252,3 +254,30 @@ const ( + AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW + AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW + ) ++ ++// poll ++ ++type PollFd C.struct_pollfd ++ ++const ( ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM ++) ++ ++// uname ++ ++type Utsname C.struct_utsname ++ ++// Clockinfo ++ ++const SizeofClockinfo = C.sizeof_struct_clockinfo ++ ++type Clockinfo C.struct_clockinfo +diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go +index 80b27781..6574f6b6 100644 +--- a/vendor/golang.org/x/sys/unix/types_dragonfly.go ++++ b/vendor/golang.org/x/sys/unix/types_dragonfly.go +@@ -17,6 +17,7 @@ package unix + #define KERNEL + #include <dirent.h> + #include <fcntl.h> ++#include <poll.h> + #include <signal.h> + #include <termios.h> + #include <stdio.h> +@@ -34,6 +35,7 @@ package unix + #include <sys/time.h> + #include <sys/types.h> + #include <sys/un.h> ++#include <sys/utsname.h> + #include <sys/wait.h> + #include <net/bpf.h> + #include <net/if.h> +@@ -63,14 +65,14 @@ struct sockaddr_any { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong + ) + + // Basic types +@@ -98,23 +100,6 @@ type _Gid_t C.gid_t + + // Files + +-const ( // Directory mode bits +- S_IFMT = C.S_IFMT +- S_IFIFO = C.S_IFIFO +- S_IFCHR = C.S_IFCHR +- S_IFDIR = C.S_IFDIR +- S_IFBLK = C.S_IFBLK +- S_IFREG = C.S_IFREG +- S_IFLNK = C.S_IFLNK +- S_IFSOCK = C.S_IFSOCK +- S_ISUID = C.S_ISUID +- S_ISGID = C.S_ISGID +- S_ISVTX = C.S_ISVTX +- S_IRUSR = C.S_IRUSR +- S_IWUSR = C.S_IWUSR +- S_IXUSR = C.S_IXUSR +-) +- + type Stat_t C.struct_stat + + type Statfs_t C.struct_statfs +@@ -125,6 +110,12 @@ type Dirent C.struct_dirent + + type Fsid C.struct_fsid + ++// File system limits ++ ++const ( ++ PathMax = C.PATH_MAX ++) ++ + // Sockets + + type RawSockaddrInet4 C.struct_sockaddr_in +@@ -241,9 +232,38 @@ type BpfHdr C.struct_bpf_hdr + + type Termios C.struct_termios + ++type Winsize C.struct_winsize ++ + // fchmodat-like syscalls. + + const ( + AT_FDCWD = C.AT_FDCWD + AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW + ) ++ ++// poll ++ ++type PollFd C.struct_pollfd ++ ++const ( ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM ++) ++ ++// Uname ++ ++type Utsname C.struct_utsname ++ ++// Clockinfo ++ ++const SizeofClockinfo = C.sizeof_struct_clockinfo ++ ++type Clockinfo C.struct_clockinfo +diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go +index 934fd7ac..c6fde424 100644 +--- a/vendor/golang.org/x/sys/unix/types_freebsd.go ++++ b/vendor/golang.org/x/sys/unix/types_freebsd.go +@@ -14,14 +14,19 @@ Input to cgo -godefs. See README.md + package unix + + /* +-#define KERNEL ++#define _WANT_FREEBSD11_STAT 1 ++#define _WANT_FREEBSD11_STATFS 1 ++#define _WANT_FREEBSD11_DIRENT 1 ++#define _WANT_FREEBSD11_KEVENT 1 ++ + #include <dirent.h> + #include <fcntl.h> ++#include <poll.h> + #include <signal.h> + #include <termios.h> + #include <stdio.h> + #include <unistd.h> +-#include <sys/capability.h> ++#include <sys/capsicum.h> + #include <sys/event.h> + #include <sys/mman.h> + #include <sys/mount.h> +@@ -35,6 +40,7 @@ package unix + #include <sys/time.h> + #include <sys/types.h> + #include <sys/un.h> ++#include <sys/utsname.h> + #include <sys/wait.h> + #include <net/bpf.h> + #include <net/if.h> +@@ -61,50 +67,6 @@ struct sockaddr_any { + char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; + }; + +-// This structure is a duplicate of stat on FreeBSD 8-STABLE. +-// See /usr/include/sys/stat.h. +-struct stat8 { +-#undef st_atimespec st_atim +-#undef st_mtimespec st_mtim +-#undef st_ctimespec st_ctim +-#undef st_birthtimespec st_birthtim +- __dev_t st_dev; +- ino_t st_ino; +- mode_t st_mode; +- nlink_t st_nlink; +- uid_t st_uid; +- gid_t st_gid; +- __dev_t st_rdev; +-#if __BSD_VISIBLE +- struct timespec st_atimespec; +- struct timespec st_mtimespec; +- struct timespec st_ctimespec; +-#else +- time_t st_atime; +- long __st_atimensec; +- time_t st_mtime; +- long __st_mtimensec; +- time_t st_ctime; +- long __st_ctimensec; +-#endif +- off_t st_size; +- blkcnt_t st_blocks; +- blksize_t st_blksize; +- fflags_t st_flags; +- __uint32_t st_gen; +- __int32_t st_lspare; +-#if __BSD_VISIBLE +- struct timespec st_birthtimespec; +- unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); +- unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); +-#else +- time_t st_birthtime; +- long st_birthtimensec; +- unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); +- unsigned int :(8 / 2) * (16 - (int)sizeof(struct __timespec)); +-#endif +-}; +- + // This structure is a duplicate of if_data on FreeBSD 8-STABLE. + // See /usr/include/net/if.h. + struct if_data8 { +@@ -152,14 +114,14 @@ struct if_msghdr8 { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong + ) + + // Basic types +@@ -187,33 +149,33 @@ type _Gid_t C.gid_t + + // Files + +-const ( // Directory mode bits +- S_IFMT = C.S_IFMT +- S_IFIFO = C.S_IFIFO +- S_IFCHR = C.S_IFCHR +- S_IFDIR = C.S_IFDIR +- S_IFBLK = C.S_IFBLK +- S_IFREG = C.S_IFREG +- S_IFLNK = C.S_IFLNK +- S_IFSOCK = C.S_IFSOCK +- S_ISUID = C.S_ISUID +- S_ISGID = C.S_ISGID +- S_ISVTX = C.S_ISVTX +- S_IRUSR = C.S_IRUSR +- S_IWUSR = C.S_IWUSR +- S_IXUSR = C.S_IXUSR ++const ( ++ _statfsVersion = C.STATFS_VERSION ++ _dirblksiz = C.DIRBLKSIZ + ) + +-type Stat_t C.struct_stat8 ++type Stat_t C.struct_stat ++ ++type stat_freebsd11_t C.struct_freebsd11_stat + + type Statfs_t C.struct_statfs + ++type statfs_freebsd11_t C.struct_freebsd11_statfs ++ + type Flock_t C.struct_flock + + type Dirent C.struct_dirent + ++type dirent_freebsd11 C.struct_freebsd11_dirent ++ + type Fsid C.struct_fsid + ++// File system limits ++ ++const ( ++ PathMax = C.PATH_MAX ++) ++ + // Advice to Fadvise + + const ( +@@ -281,14 +243,58 @@ const ( + // Ptrace requests + + const ( +- PTRACE_TRACEME = C.PT_TRACE_ME +- PTRACE_CONT = C.PT_CONTINUE +- PTRACE_KILL = C.PT_KILL ++ PTRACE_ATTACH = C.PT_ATTACH ++ PTRACE_CONT = C.PT_CONTINUE ++ PTRACE_DETACH = C.PT_DETACH ++ PTRACE_GETFPREGS = C.PT_GETFPREGS ++ PTRACE_GETFSBASE = C.PT_GETFSBASE ++ PTRACE_GETLWPLIST = C.PT_GETLWPLIST ++ PTRACE_GETNUMLWPS = C.PT_GETNUMLWPS ++ PTRACE_GETREGS = C.PT_GETREGS ++ PTRACE_GETXSTATE = C.PT_GETXSTATE ++ PTRACE_IO = C.PT_IO ++ PTRACE_KILL = C.PT_KILL ++ PTRACE_LWPEVENTS = C.PT_LWP_EVENTS ++ PTRACE_LWPINFO = C.PT_LWPINFO ++ PTRACE_SETFPREGS = C.PT_SETFPREGS ++ PTRACE_SETREGS = C.PT_SETREGS ++ PTRACE_SINGLESTEP = C.PT_STEP ++ PTRACE_TRACEME = C.PT_TRACE_ME ++) ++ ++const ( ++ PIOD_READ_D = C.PIOD_READ_D ++ PIOD_WRITE_D = C.PIOD_WRITE_D ++ PIOD_READ_I = C.PIOD_READ_I ++ PIOD_WRITE_I = C.PIOD_WRITE_I ++) ++ ++const ( ++ PL_FLAG_BORN = C.PL_FLAG_BORN ++ PL_FLAG_EXITED = C.PL_FLAG_EXITED ++ PL_FLAG_SI = C.PL_FLAG_SI ++) ++ ++const ( ++ TRAP_BRKPT = C.TRAP_BRKPT ++ TRAP_TRACE = C.TRAP_TRACE + ) + ++type PtraceLwpInfoStruct C.struct_ptrace_lwpinfo ++ ++type __Siginfo C.struct___siginfo ++ ++type Sigset_t C.sigset_t ++ ++type Reg C.struct_reg ++ ++type FpReg C.struct_fpreg ++ ++type PtraceIoDesc C.struct_ptrace_io_desc ++ + // Events (kqueue, kevent) + +-type Kevent_t C.struct_kevent ++type Kevent_t C.struct_kevent_freebsd11 + + // Select + +@@ -367,6 +373,34 @@ const ( + AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW + ) + ++// poll ++ ++type PollFd C.struct_pollfd ++ ++const ( ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLINIGNEOF = C.POLLINIGNEOF ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM ++) ++ + // Capabilities + + type CapRights C.struct_cap_rights ++ ++// Uname ++ ++type Utsname C.struct_utsname ++ ++// Clockinfo ++ ++const SizeofClockinfo = C.sizeof_struct_clockinfo ++ ++type Clockinfo C.struct_clockinfo +diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go +index cb95c80a..0a81aadb 100644 +--- a/vendor/golang.org/x/sys/unix/types_netbsd.go ++++ b/vendor/golang.org/x/sys/unix/types_netbsd.go +@@ -17,6 +17,7 @@ package unix + #define KERNEL + #include <dirent.h> + #include <fcntl.h> ++#include <poll.h> + #include <signal.h> + #include <termios.h> + #include <stdio.h> +@@ -32,10 +33,12 @@ package unix + #include <sys/signal.h> + #include <sys/socket.h> + #include <sys/stat.h> ++#include <sys/statvfs.h> + #include <sys/sysctl.h> + #include <sys/time.h> + #include <sys/uio.h> + #include <sys/un.h> ++#include <sys/utsname.h> + #include <sys/wait.h> + #include <net/bpf.h> + #include <net/if.h> +@@ -65,14 +68,14 @@ struct sockaddr_any { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong + ) + + // Basic types +@@ -104,12 +107,38 @@ type Stat_t C.struct_stat + + type Statfs_t C.struct_statfs + ++type Statvfs_t C.struct_statvfs ++ + type Flock_t C.struct_flock + + type Dirent C.struct_dirent + + type Fsid C.fsid_t + ++// File system limits ++ ++const ( ++ PathMax = C.PATH_MAX ++) ++ ++// Fstatvfs/Statvfs flags ++ ++const ( ++ ST_WAIT = C.ST_WAIT ++ ST_NOWAIT = C.ST_NOWAIT ++) ++ ++// Advice to Fadvise ++ ++const ( ++ FADV_NORMAL = C.POSIX_FADV_NORMAL ++ FADV_RANDOM = C.POSIX_FADV_RANDOM ++ FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL ++ FADV_WILLNEED = C.POSIX_FADV_WILLNEED ++ FADV_DONTNEED = C.POSIX_FADV_DONTNEED ++ FADV_NOREUSE = C.POSIX_FADV_NOREUSE ++) ++ + // Sockets + + type RawSockaddrInet4 C.struct_sockaddr_in +@@ -227,13 +256,45 @@ type BpfTimeval C.struct_bpf_timeval + + type Termios C.struct_termios + ++type Winsize C.struct_winsize ++ ++type Ptmget C.struct_ptmget ++ + // fchmodat-like syscalls. + + const ( + AT_FDCWD = C.AT_FDCWD ++ AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW + AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW + ) + ++// poll ++ ++type PollFd C.struct_pollfd ++ ++const ( ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM ++) ++ + // Sysctl + + type Sysctlnode C.struct_sysctlnode ++ ++// Uname ++ ++type Utsname C.struct_utsname ++ ++// Clockinfo ++ ++const SizeofClockinfo = C.sizeof_struct_clockinfo ++ ++type Clockinfo C.struct_clockinfo +diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go +index 392da69b..775cb57d 100644 +--- a/vendor/golang.org/x/sys/unix/types_openbsd.go ++++ b/vendor/golang.org/x/sys/unix/types_openbsd.go +@@ -17,6 +17,7 @@ package unix + #define KERNEL + #include <dirent.h> + #include <fcntl.h> ++#include <poll.h> + #include <signal.h> + #include <termios.h> + #include <stdio.h> +@@ -35,7 +36,9 @@ package unix + #include <sys/time.h> + #include <sys/uio.h> + #include <sys/un.h> ++#include <sys/utsname.h> + #include <sys/wait.h> ++#include <uvm/uvmexp.h> + #include <net/bpf.h> + #include <net/if.h> + #include <net/if_dl.h> +@@ -64,14 +67,14 @@ struct sockaddr_any { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong + ) + + // Basic types +@@ -99,23 +102,6 @@ type _Gid_t C.gid_t + + // Files + +-const ( // Directory mode bits +- S_IFMT = C.S_IFMT +- S_IFIFO = C.S_IFIFO +- S_IFCHR = C.S_IFCHR +- S_IFDIR = C.S_IFDIR +- S_IFBLK = C.S_IFBLK +- S_IFREG = C.S_IFREG +- S_IFLNK = C.S_IFLNK +- S_IFSOCK = C.S_IFSOCK +- S_ISUID = C.S_ISUID +- S_ISGID = C.S_ISGID +- S_ISVTX = C.S_ISVTX +- S_IRUSR = C.S_IRUSR +- S_IWUSR = C.S_IWUSR +- S_IXUSR = C.S_IXUSR +-) +- + type Stat_t C.struct_stat + + type Statfs_t C.struct_statfs +@@ -126,6 +112,12 @@ type Dirent C.struct_dirent + + type Fsid C.fsid_t + ++// File system limits ++ ++const ( ++ PathMax = C.PATH_MAX ++) ++ + // Sockets + + type RawSockaddrInet4 C.struct_sockaddr_in +@@ -243,9 +235,49 @@ type BpfTimeval C.struct_bpf_timeval + + type Termios C.struct_termios + ++type Winsize C.struct_winsize ++ + // fchmodat-like syscalls. + + const ( + AT_FDCWD = C.AT_FDCWD ++ AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW + AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW + ) ++ ++// poll ++ ++type PollFd C.struct_pollfd ++ ++const ( ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM ++) ++ ++// Signal Sets ++ ++type Sigset_t C.sigset_t ++ ++// Uname ++ ++type Utsname C.struct_utsname ++ ++// Uvmexp ++ ++const SizeofUvmexp = C.sizeof_struct_uvmexp ++ ++type Uvmexp C.struct_uvmexp ++ ++// Clockinfo ++ ++const SizeofClockinfo = C.sizeof_struct_clockinfo ++ ++type Clockinfo C.struct_clockinfo +diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go +index 393c7f04..d713f09e 100644 +--- a/vendor/golang.org/x/sys/unix/types_solaris.go ++++ b/vendor/golang.org/x/sys/unix/types_solaris.go +@@ -24,6 +24,7 @@ package unix + #include <fcntl.h> + #include <netdb.h> + #include <limits.h> ++#include <poll.h> + #include <signal.h> + #include <termios.h> + #include <termio.h> +@@ -74,14 +75,14 @@ struct sockaddr_any { + */ + import "C" + +-// Machine characteristics; for internal use. ++// Machine characteristics + + const ( +- sizeofPtr = C.sizeofPtr +- sizeofShort = C.sizeof_short +- sizeofInt = C.sizeof_int +- sizeofLong = C.sizeof_long +- sizeofLongLong = C.sizeof_longlong ++ SizeofPtr = C.sizeofPtr ++ SizeofShort = C.sizeof_short ++ SizeofInt = C.sizeof_int ++ SizeofLong = C.sizeof_long ++ SizeofLongLong = C.sizeof_longlong + PathMax = C.PATH_MAX + MaxHostNameLen = C.MAXHOSTNAMELEN + ) +@@ -117,23 +118,6 @@ type _Gid_t C.gid_t + + // Files + +-const ( // Directory mode bits +- S_IFMT = C.S_IFMT +- S_IFIFO = C.S_IFIFO +- S_IFCHR = C.S_IFCHR +- S_IFDIR = C.S_IFDIR +- S_IFBLK = C.S_IFBLK +- S_IFREG = C.S_IFREG +- S_IFLNK = C.S_IFLNK +- S_IFSOCK = C.S_IFSOCK +- S_ISUID = C.S_ISUID +- S_ISGID = C.S_ISGID +- S_ISVTX = C.S_ISVTX +- S_IRUSR = C.S_IRUSR +- S_IWUSR = C.S_IWUSR +- S_IXUSR = C.S_IXUSR +-) +- + type Stat_t C.struct_stat + + type Flock_t C.struct_flock +@@ -174,6 +158,8 @@ type Msghdr C.struct_msghdr + + type Cmsghdr C.struct_cmsghdr + ++type Inet4Pktinfo C.struct_in_pktinfo ++ + type Inet6Pktinfo C.struct_in6_pktinfo + + type IPv6MTUInfo C.struct_ip6_mtuinfo +@@ -191,6 +177,7 @@ const ( + SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq + SizeofMsghdr = C.sizeof_struct_msghdr + SizeofCmsghdr = C.sizeof_struct_cmsghdr ++ SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo + SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo + SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo + SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter +@@ -256,10 +243,6 @@ type BpfTimeval C.struct_bpf_timeval + + type BpfHdr C.struct_bpf_hdr + +-// sysconf information +- +-const _SC_PAGESIZE = C._SC_PAGESIZE +- + // Terminal handling + + type Termios C.struct_termios +@@ -267,3 +250,20 @@ type Termios C.struct_termios + type Termio C.struct_termio + + type Winsize C.struct_winsize ++ ++// poll ++ ++type PollFd C.struct_pollfd ++ ++const ( ++ POLLERR = C.POLLERR ++ POLLHUP = C.POLLHUP ++ POLLIN = C.POLLIN ++ POLLNVAL = C.POLLNVAL ++ POLLOUT = C.POLLOUT ++ POLLPRI = C.POLLPRI ++ POLLRDBAND = C.POLLRDBAND ++ POLLRDNORM = C.POLLRDNORM ++ POLLWRBAND = C.POLLWRBAND ++ POLLWRNORM = C.POLLWRNORM ++) +diff --git a/vendor/golang.org/x/sys/unix/unveil_openbsd.go b/vendor/golang.org/x/sys/unix/unveil_openbsd.go +new file mode 100644 +index 00000000..168d5ae7 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/unveil_openbsd.go +@@ -0,0 +1,42 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++package unix ++ ++import ( ++ "syscall" ++ "unsafe" ++) ++ ++// Unveil implements the unveil syscall. ++// For more information see unveil(2). ++// Note that the special case of blocking further ++// unveil calls is handled by UnveilBlock. ++func Unveil(path string, flags string) error { ++ pathPtr, err := syscall.BytePtrFromString(path) ++ if err != nil { ++ return err ++ } ++ flagsPtr, err := syscall.BytePtrFromString(flags) ++ if err != nil { ++ return err ++ } ++ _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) ++ if e != 0 { ++ return e ++ } ++ return nil ++} ++ ++// UnveilBlock blocks future unveil calls. ++// For more information see unveil(2). ++func UnveilBlock() error { ++ // Both pointers must be nil. ++ var pathUnsafe, flagsUnsafe unsafe.Pointer ++ _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) ++ if e != 0 { ++ return e ++ } ++ return nil ++} +diff --git a/vendor/golang.org/x/sys/unix/xattr_bsd.go b/vendor/golang.org/x/sys/unix/xattr_bsd.go +new file mode 100644 +index 00000000..30c1d71f +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/xattr_bsd.go +@@ -0,0 +1,240 @@ ++// Copyright 2018 The Go Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style ++// license that can be found in the LICENSE file. ++ ++// +build freebsd netbsd ++ ++package unix ++ ++import ( ++ "strings" ++ "unsafe" ++) ++ ++// Derive extattr namespace and attribute name ++ ++func xattrnamespace(fullattr string) (ns int, attr string, err error) { ++ s := strings.IndexByte(fullattr, '.') ++ if s == -1 { ++ return -1, "", ENOATTR ++ } ++ ++ namespace := fullattr[0:s] ++ attr = fullattr[s+1:] ++ ++ switch namespace { ++ case "user": ++ return EXTATTR_NAMESPACE_USER, attr, nil ++ case "system": ++ return EXTATTR_NAMESPACE_SYSTEM, attr, nil ++ default: ++ return -1, "", ENOATTR ++ } ++} ++ ++func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) { ++ if len(dest) > idx { ++ return unsafe.Pointer(&dest[idx]) ++ } else { ++ return unsafe.Pointer(_zero) ++ } ++} ++ ++// FreeBSD and NetBSD implement their own syscalls to handle extended attributes ++ ++func Getxattr(file string, attr string, dest []byte) (sz int, err error) { ++ d := initxattrdest(dest, 0) ++ destsize := len(dest) ++ ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return -1, err ++ } ++ ++ return ExtattrGetFile(file, nsid, a, uintptr(d), destsize) ++} ++ ++func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { ++ d := initxattrdest(dest, 0) ++ destsize := len(dest) ++ ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return -1, err ++ } ++ ++ return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize) ++} ++ ++func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { ++ d := initxattrdest(dest, 0) ++ destsize := len(dest) ++ ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return -1, err ++ } ++ ++ return ExtattrGetLink(link, nsid, a, uintptr(d), destsize) ++} ++ ++// flags are unused on FreeBSD ++ ++func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { ++ var d unsafe.Pointer ++ if len(data) > 0 { ++ d = unsafe.Pointer(&data[0]) ++ } ++ datasiz := len(data) ++ ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return ++ } ++ ++ _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz) ++ return ++} ++ ++func Setxattr(file string, attr string, data []byte, flags int) (err error) { ++ var d unsafe.Pointer ++ if len(data) > 0 { ++ d = unsafe.Pointer(&data[0]) ++ } ++ datasiz := len(data) ++ ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return ++ } ++ ++ _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz) ++ return ++} ++ ++func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { ++ var d unsafe.Pointer ++ if len(data) > 0 { ++ d = unsafe.Pointer(&data[0]) ++ } ++ datasiz := len(data) ++ ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return ++ } ++ ++ _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz) ++ return ++} ++ ++func Removexattr(file string, attr string) (err error) { ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return ++ } ++ ++ err = ExtattrDeleteFile(file, nsid, a) ++ return ++} ++ ++func Fremovexattr(fd int, attr string) (err error) { ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return ++ } ++ ++ err = ExtattrDeleteFd(fd, nsid, a) ++ return ++} ++ ++func Lremovexattr(link string, attr string) (err error) { ++ nsid, a, err := xattrnamespace(attr) ++ if err != nil { ++ return ++ } ++ ++ err = ExtattrDeleteLink(link, nsid, a) ++ return ++} ++ ++func Listxattr(file string, dest []byte) (sz int, err error) { ++ d := initxattrdest(dest, 0) ++ destsiz := len(dest) ++ ++ // FreeBSD won't allow you to list xattrs from multiple namespaces ++ s := 0 ++ for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { ++ stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz) ++ ++ /* Errors accessing system attrs are ignored so that ++ * we can implement the Linux-like behavior of omitting errors that ++ * we don't have read permissions on ++ * ++ * Linux will still error if we ask for user attributes on a file that ++ * we don't have read permissions on, so don't ignore those errors ++ */ ++ if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { ++ continue ++ } else if e != nil { ++ return s, e ++ } ++ ++ s += stmp ++ destsiz -= s ++ if destsiz < 0 { ++ destsiz = 0 ++ } ++ d = initxattrdest(dest, s) ++ } ++ ++ return s, nil ++} ++ ++func Flistxattr(fd int, dest []byte) (sz int, err error) { ++ d := initxattrdest(dest, 0) ++ destsiz := len(dest) ++ ++ s := 0 ++ for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { ++ stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz) ++ if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { ++ continue ++ } else if e != nil { ++ return s, e ++ } ++ ++ s += stmp ++ destsiz -= s ++ if destsiz < 0 { ++ destsiz = 0 ++ } ++ d = initxattrdest(dest, s) ++ } ++ ++ return s, nil ++} ++ ++func Llistxattr(link string, dest []byte) (sz int, err error) { ++ d := initxattrdest(dest, 0) ++ destsiz := len(dest) ++ ++ s := 0 ++ for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { ++ stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz) ++ if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { ++ continue ++ } else if e != nil { ++ return s, e ++ } ++ ++ s += stmp ++ destsiz -= s ++ if destsiz < 0 { ++ destsiz = 0 ++ } ++ d = initxattrdest(dest, s) ++ } ++ ++ return s, nil ++} +diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +new file mode 100644 +index 00000000..104994bc +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +@@ -0,0 +1,1384 @@ ++// 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 ++ MCAST_BLOCK_SOURCE = 0x40 ++ MCAST_EXCLUDE = 0x2 ++ MCAST_INCLUDE = 0x1 ++ MCAST_JOIN_GROUP = 0x3e ++ MCAST_JOIN_SOURCE_GROUP = 0x42 ++ MCAST_LEAVE_GROUP = 0x3f ++ MCAST_LEAVE_SOURCE_GROUP = 0x43 ++ MCAST_SOURCE_FILTER = 0x49 ++ MCAST_UNBLOCK_SOURCE = 0x41 ++ 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 ++ NFDBITS = 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 = -0x3fdf9669 ++ 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 ++ TIMER_ABSTIME = 0x3e7 ++ TIMER_MAX = 0x20 ++ 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/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +new file mode 100644 +index 00000000..4fc8d306 +--- /dev/null ++++ b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +@@ -0,0 +1,1385 @@ ++// mkerrors.sh -maix64 ++// Code generated by the command above; see README.md. DO NOT EDIT. ++ ++// +build ppc64,aix ++ ++// Code generated by cmd/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 ++ MCAST_BLOCK_SOURCE = 0x40 ++ MCAST_EXCLUDE = 0x2 ++ MCAST_INCLUDE = 0x1 ++ MCAST_JOIN_GROUP = 0x3e ++ MCAST_JOIN_SOURCE_GROUP = 0x42 ++ MCAST_LEAVE_GROUP = 0x3f ++ MCAST_LEAVE_SOURCE_GROUP = 0x43 ++ MCAST_SOURCE_FILTER = 0x49 ++ MCAST_UNBLOCK_SOURCE = 0x41 ++ 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 ++ NFDBITS = 0x40 ++ 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 = -0x3fdf9669 ++ 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 ++ TIMER_ABSTIME = 0x3e7 ++ TIMER_MAX = 0x20 ++ TIOC = 0x5400 ++ TIOCCBRK = 0x2000747a ++ TIOCCDTR = 0x20007478 ++ TIOCCONS = 0xffffffff80047462 ++ TIOCEXCL = 0x2000740d ++ TIOCFLUSH = 0xffffffff80047410 ++ TIOCGETC = 0x40067412 ++ TIOCGETD = 0x40047400 ++ TIOCGETP = 0x40067408 ++ TIOCGLTC = 0x40067474 ++ TIOCGPGRP = 0x40047477 ++ TIOCGSID = 0x40047448 ++ TIOCGSIZE = 0x40087468 ++ TIOCGWINSZ = 0x40087468 ++ TIOCHPCL = 0x20007402 ++ TIOCLBIC = 0xffffffff8004747e ++ TIOCLBIS = 0xffffffff8004747f ++ TIOCLGET = 0x4004747c ++ TIOCLSET = 0xffffffff8004747d ++ TIOCMBIC = 0xffffffff8004746b ++ TIOCMBIS = 0xffffffff8004746c ++ TIOCMGET = 0x4004746a ++ TIOCMIWAIT = 0xffffffff80047464 ++ TIOCMODG = 0x40047403 ++ TIOCMODS = 0xffffffff80047404 ++ TIOCMSET = 0xffffffff8004746d ++ TIOCM_CAR = 0x40 ++ TIOCM_CD = 0x40 ++ TIOCM_CTS = 0x20 ++ TIOCM_DSR = 0x100 ++ TIOCM_DTR = 0x2 ++ TIOCM_LE = 0x1 ++ TIOCM_RI = 0x80 ++ TIOCM_RNG = 0x80 ++ TIOCM_RTS = 0x4 ++ TIOCM_SR = 0x10 ++ TIOCM_ST = 0x8 ++ TIOCNOTTY = 0x20007471 ++ TIOCNXCL = 0x2000740e ++ TIOCOUTQ = 0x40047473 ++ TIOCPKT = 0xffffffff80047470 ++ TIOCPKT_DATA = 0x0 ++ TIOCPKT_DOSTOP = 0x20 ++ TIOCPKT_FLUSHREAD = 0x1 ++ TIOCPKT_FLUSHWRITE = 0x2 ++ TIOCPKT_NOSTOP = 0x10 ++ TIOCPKT_START = 0x8 ++ TIOCPKT_STOP = 0x4 ++ TIOCREMOTE = 0xffffffff80047469 ++ TIOCSBRK = 0x2000747b ++ TIOCSDTR = 0x20007479 ++ TIOCSETC = 0xffffffff80067411 ++ TIOCSETD = 0xffffffff80047401 ++ TIOCSETN = 0xffffffff8006740a ++ TIOCSETP = 0xffffffff80067409 ++ TIOCSLTC = 0xffffffff80067475 ++ TIOCSPGRP = 0xffffffff80047476 ++ TIOCSSIZE = 0xffffffff80087467 ++ TIOCSTART = 0x2000746e ++ TIOCSTI = 0xffffffff80017472 ++ TIOCSTOP = 0x2000746f ++ TIOCSWINSZ = 0xffffffff80087467 ++ TIOCUCNTL = 0xffffffff80047466 ++ TOSTOP = 0x10000 ++ UTIME_NOW = -0x2 ++ UTIME_OMIT = -0x3 ++ VDISCRD = 0xc ++ VDSUSP = 0xa ++ VEOF = 0x4 ++ VEOL = 0x5 ++ VEOL2 = 0x6 ++ VERASE = 0x2 ++ VINTR = 0x0 ++ VKILL = 0x3 ++ VLNEXT = 0xe ++ VMIN = 0x4 ++ VQUIT = 0x1 ++ VREPRINT = 0xb ++ VSTART = 0x7 ++ VSTOP = 0x8 ++ VSTRT = 0x7 ++ VSUSP = 0x9 ++ VT0 = 0x0 ++ VT1 = 0x8000 ++ VTDELAY = 0x2000 ++ VTDLY = 0x8000 ++ VTIME = 0x5 ++ VWERSE = 0xd ++ WPARSTART = 0x1 ++ WPARSTOP = 0x2 ++ WPARTTYNAME = "Global" ++ XCASE = 0x4 ++ XTABS = 0xc00 ++ _FDATAFLUSH = 0x2000000000 ++) ++ ++// Errors ++const ( ++ E2BIG = syscall.Errno(0x7) ++ EACCES = syscall.Errno(0xd) ++ EADDRINUSE = syscall.Errno(0x43) ++ EADDRNOTAVAIL = syscall.Errno(0x44) ++ EAFNOSUPPORT = syscall.Errno(0x42) ++ EAGAIN = syscall.Errno(0xb) ++ EALREADY = syscall.Errno(0x38) ++ EBADF = syscall.Errno(0x9) ++ EBADMSG = syscall.Errno(0x78) ++ EBUSY = syscall.Errno(0x10) ++ ECANCELED = syscall.Errno(0x75) ++ ECHILD = syscall.Errno(0xa) ++ ECHRNG = syscall.Errno(0x25) ++ ECLONEME = syscall.Errno(0x52) ++ ECONNABORTED = syscall.Errno(0x48) ++ ECONNREFUSED = syscall.Errno(0x4f) ++ ECONNRESET = syscall.Errno(0x49) ++ ECORRUPT = syscall.Errno(0x59) ++ EDEADLK = syscall.Errno(0x2d) ++ EDESTADDREQ = syscall.Errno(0x3a) ++ EDESTADDRREQ = syscall.Errno(0x3a) ++ EDIST = syscall.Errno(0x35) ++ EDOM = syscall.Errno(0x21) ++ EDQUOT = syscall.Errno(0x58) ++ EEXIST = syscall.Errno(0x11) ++ EFAULT = syscall.Errno(0xe) ++ EFBIG = syscall.Errno(0x1b) ++ EFORMAT = syscall.Errno(0x30) ++ EHOSTDOWN = syscall.Errno(0x50) ++ EHOSTUNREACH = syscall.Errno(0x51) ++ EIDRM = syscall.Errno(0x24) ++ EILSEQ = syscall.Errno(0x74) ++ EINPROGRESS = syscall.Errno(0x37) ++ EINTR = syscall.Errno(0x4) ++ EINVAL = syscall.Errno(0x16) ++ EIO = syscall.Errno(0x5) ++ EISCONN = syscall.Errno(0x4b) ++ EISDIR = syscall.Errno(0x15) ++ EL2HLT = syscall.Errno(0x2c) ++ EL2NSYNC = syscall.Errno(0x26) ++ EL3HLT = syscall.Errno(0x27) ++ EL3RST = syscall.Errno(0x28) ++ ELNRNG = syscall.Errno(0x29) ++ ELOOP = syscall.Errno(0x55) ++ EMEDIA = syscall.Errno(0x6e) ++ EMFILE = syscall.Errno(0x18) ++ EMLINK = syscall.Errno(0x1f) ++ EMSGSIZE = syscall.Errno(0x3b) ++ EMULTIHOP = syscall.Errno(0x7d) ++ ENAMETOOLONG = syscall.Errno(0x56) ++ ENETDOWN = syscall.Errno(0x45) ++ ENETRESET = syscall.Errno(0x47) ++ ENETUNREACH = syscall.Errno(0x46) ++ ENFILE = syscall.Errno(0x17) ++ ENOATTR = syscall.Errno(0x70) ++ ENOBUFS = syscall.Errno(0x4a) ++ ENOCONNECT = syscall.Errno(0x32) ++ ENOCSI = syscall.Errno(0x2b) ++ ENODATA = syscall.Errno(0x7a) ++ ENODEV = syscall.Errno(0x13) ++ ENOENT = syscall.Errno(0x2) ++ ENOEXEC = syscall.Errno(0x8) ++ ENOLCK = syscall.Errno(0x31) ++ ENOLINK = syscall.Errno(0x7e) ++ ENOMEM = syscall.Errno(0xc) ++ ENOMSG = syscall.Errno(0x23) ++ ENOPROTOOPT = syscall.Errno(0x3d) ++ ENOSPC = syscall.Errno(0x1c) ++ ENOSR = syscall.Errno(0x76) ++ ENOSTR = syscall.Errno(0x7b) ++ ENOSYS = syscall.Errno(0x6d) ++ ENOTBLK = syscall.Errno(0xf) ++ ENOTCONN = syscall.Errno(0x4c) ++ ENOTDIR = syscall.Errno(0x14) ++ ENOTEMPTY = syscall.Errno(0x11) ++ ENOTREADY = syscall.Errno(0x2e) ++ ENOTRECOVERABLE = syscall.Errno(0x5e) ++ ENOTRUST = syscall.Errno(0x72) ++ ENOTSOCK = syscall.Errno(0x39) ++ ENOTSUP = syscall.Errno(0x7c) ++ ENOTTY = syscall.Errno(0x19) ++ ENXIO = syscall.Errno(0x6) ++ EOPNOTSUPP = syscall.Errno(0x40) ++ EOVERFLOW = syscall.Errno(0x7f) ++ EOWNERDEAD = syscall.Errno(0x5f) ++ EPERM = syscall.Errno(0x1) ++ EPFNOSUPPORT = syscall.Errno(0x41) ++ EPIPE = syscall.Errno(0x20) ++ EPROCLIM = syscall.Errno(0x53) ++ EPROTO = syscall.Errno(0x79) ++ EPROTONOSUPPORT = syscall.Errno(0x3e) ++ EPROTOTYPE = syscall.Errno(0x3c) ++ ERANGE = syscall.Errno(0x22) ++ EREMOTE = syscall.Errno(0x5d) ++ ERESTART = syscall.Errno(0x52) ++ EROFS = syscall.Errno(0x1e) ++ ESAD = syscall.Errno(0x71) ++ ESHUTDOWN = syscall.Errno(0x4d) ++ ESOCKTNOSUPPORT = syscall.Errno(0x3f) ++ ESOFT = syscall.Errno(0x6f) ++ ESPIPE = syscall.Errno(0x1d) ++ ESRCH = syscall.Errno(0x3) ++ ESTALE = syscall.Errno(0x34) ++ ESYSERROR = syscall.Errno(0x5a) ++ ETIME = syscall.Errno(0x77) ++ ETIMEDOUT = syscall.Errno(0x4e) ++ ETOOMANYREFS = syscall.Errno(0x73) ++ ETXTBSY = syscall.Errno(0x1a) ++ EUNATCH = syscall.Errno(0x2a) ++ EUSERS = syscall.Errno(0x54) ++ EWOULDBLOCK = syscall.Errno(0xb) ++ EWRPROTECT = syscall.Errno(0x2f) ++ EXDEV = syscall.Errno(0x12) ++) ++ ++// Signals ++const ( ++ SIGABRT = syscall.Signal(0x6) ++ SIGAIO = syscall.Signal(0x17) ++ SIGALRM = syscall.Signal(0xe) ++ SIGALRM1 = syscall.Signal(0x26) ++ SIGBUS = syscall.Signal(0xa) ++ SIGCAPI = syscall.Signal(0x31) ++ SIGCHLD = syscall.Signal(0x14) ++ SIGCLD = syscall.Signal(0x14) ++ SIGCONT = syscall.Signal(0x13) ++ SIGCPUFAIL = syscall.Signal(0x3b) ++ SIGDANGER = syscall.Signal(0x21) ++ SIGEMT = syscall.Signal(0x7) ++ SIGFPE = syscall.Signal(0x8) ++ SIGGRANT = syscall.Signal(0x3c) ++ SIGHUP = syscall.Signal(0x1) ++ SIGILL = syscall.Signal(0x4) ++ SIGINT = syscall.Signal(0x2) ++ SIGIO = syscall.Signal(0x17) ++ SIGIOINT = syscall.Signal(0x10) ++ SIGIOT = syscall.Signal(0x6) ++ SIGKAP = syscall.Signal(0x3c) ++ SIGKILL = syscall.Signal(0x9) ++ SIGLOST = syscall.Signal(0x6) ++ SIGMAX = syscall.Signal(0xff) ++ SIGMAX32 = syscall.Signal(0x3f) ++ SIGMIGRATE = syscall.Signal(0x23) ++ SIGMSG = syscall.Signal(0x1b) ++ SIGPIPE = syscall.Signal(0xd) ++ SIGPOLL = syscall.Signal(0x17) ++ SIGPRE = syscall.Signal(0x24) ++ SIGPROF = syscall.Signal(0x20) ++ SIGPTY = syscall.Signal(0x17) ++ SIGPWR = syscall.Signal(0x1d) ++ SIGQUIT = syscall.Signal(0x3) ++ SIGRECONFIG = syscall.Signal(0x3a) ++ SIGRETRACT = syscall.Signal(0x3d) ++ SIGSAK = syscall.Signal(0x3f) ++ SIGSEGV = syscall.Signal(0xb) ++ SIGSOUND = syscall.Signal(0x3e) ++ SIGSTOP = syscall.Signal(0x11) ++ SIGSYS = syscall.Signal(0xc) ++ SIGSYSERROR = syscall.Signal(0x30) ++ SIGTALRM = syscall.Signal(0x26) ++ SIGTERM = syscall.Signal(0xf) ++ SIGTRAP = syscall.Signal(0x5) ++ SIGTSTP = syscall.Signal(0x12) ++ SIGTTIN = syscall.Signal(0x15) ++ SIGTTOU = syscall.Signal(0x16) ++ SIGURG = syscall.Signal(0x10) ++ SIGUSR1 = syscall.Signal(0x1e) ++ SIGUSR2 = syscall.Signal(0x1f) ++ SIGVIRT = syscall.Signal(0x25) ++ SIGVTALRM = syscall.Signal(0x22) ++ SIGWAITING = syscall.Signal(0x27) ++ SIGWINCH = syscall.Signal(0x1c) ++ SIGXCPU = syscall.Signal(0x18) ++ SIGXFSZ = syscall.Signal(0x19) ++) ++ ++// Error table ++var errorList = [...]struct { ++ num syscall.Errno ++ name string ++ desc string ++}{ ++ {1, "EPERM", "not owner"}, ++ {2, "ENOENT", "no such file or directory"}, ++ {3, "ESRCH", "no such process"}, ++ {4, "EINTR", "interrupted system call"}, ++ {5, "EIO", "I/O error"}, ++ {6, "ENXIO", "no such device or address"}, ++ {7, "E2BIG", "arg list too long"}, ++ {8, "ENOEXEC", "exec format error"}, ++ {9, "EBADF", "bad file number"}, ++ {10, "ECHILD", "no child processes"}, ++ {11, "EWOULDBLOCK", "resource temporarily unavailable"}, ++ {12, "ENOMEM", "not enough space"}, ++ {13, "EACCES", "permission denied"}, ++ {14, "EFAULT", "bad address"}, ++ {15, "ENOTBLK", "block device required"}, ++ {16, "EBUSY", "device busy"}, ++ {17, "ENOTEMPTY", "file exists"}, ++ {18, "EXDEV", "cross-device link"}, ++ {19, "ENODEV", "no such device"}, ++ {20, "ENOTDIR", "not a directory"}, ++ {21, "EISDIR", "is a directory"}, ++ {22, "EINVAL", "invalid argument"}, ++ {23, "ENFILE", "file table overflow"}, ++ {24, "EMFILE", "too many open files"}, ++ {25, "ENOTTY", "not a typewriter"}, ++ {26, "ETXTBSY", "text file busy"}, ++ {27, "EFBIG", "file too large"}, ++ {28, "ENOSPC", "no space left on device"}, ++ {29, "ESPIPE", "illegal seek"}, ++ {30, "EROFS", "read-only file system"}, ++ {31, "EMLINK", "too many links"}, ++ {32, "EPIPE", "broken pipe"}, ++ {33, "EDOM", "argument out of domain"}, ++ {34, "ERANGE", "result too large"}, ++ {35, "ENOMSG", "no message of desired type"}, ++ {36, "EIDRM", "identifier removed"}, ++ {37, "ECHRNG", "channel number out of range"}, ++ {38, "EL2NSYNC", "level 2 not synchronized"}, ++ {39, "EL3HLT", "level 3 halted"}, ++ {40, "EL3RST", "level 3 reset"}, ++ {41, "ELNRNG", "link number out of range"}, ++ {42, "EUNATCH", "protocol driver not attached"}, ++ {43, "ENOCSI", "no CSI structure available"}, ++ {44, "EL2HLT", "level 2 halted"}, ++ {45, "EDEADLK", "deadlock condition if locked"}, ++ {46, "ENOTREADY", "device not ready"}, ++ {47, "EWRPROTECT", "write-protected media"}, ++ {48, "EFORMAT", "unformatted or incompatible media"}, ++ {49, "ENOLCK", "no locks available"}, ++ {50, "ENOCONNECT", "cannot Establish Connection"}, ++ {52, "ESTALE", "missing file or filesystem"}, ++ {53, "EDIST", "requests blocked by Administrator"}, ++ {55, "EINPROGRESS", "operation now in progress"}, ++ {56, "EALREADY", "operation already in progress"}, ++ {57, "ENOTSOCK", "socket operation on non-socket"}, ++ {58, "EDESTADDREQ", "destination address required"}, ++ {59, "EMSGSIZE", "message too long"}, ++ {60, "EPROTOTYPE", "protocol wrong type for socket"}, ++ {61, "ENOPROTOOPT", "protocol not available"}, ++ {62, "EPROTONOSUPPORT", "protocol not supported"}, ++ {63, "ESOCKTNOSUPPORT", "socket type not supported"}, ++ {64, "EOPNOTSUPP", "operation not supported on socket"}, ++ {65, "EPFNOSUPPORT", "protocol family not supported"}, ++ {66, "EAFNOSUPPORT", "addr family not supported by protocol"}, ++ {67, "EADDRINUSE", "address already in use"}, ++ {68, "EADDRNOTAVAIL", "can't assign requested address"}, ++ {69, "ENETDOWN", "network is down"}, ++ {70, "ENETUNREACH", "network is unreachable"}, ++ {71, "ENETRESET", "network dropped connection on reset"}, ++ {72, "ECONNABORTED", "software caused connection abort"}, ++ {73, "ECONNRESET", "connection reset by peer"}, ++ {74, "ENOBUFS", "no buffer space available"}, ++ {75, "EISCONN", "socket is already connected"}, ++ {76, "ENOTCONN", "socket is not connected"}, ++ {77, "ESHUTDOWN", "can't send after socket shutdown"}, ++ {78, "ETIMEDOUT", "connection timed out"}, ++ {79, "ECONNREFUSED", "connection refused"}, ++ {80, "EHOSTDOWN", "host is down"}, ++ {81, "EHOSTUNREACH", "no route to host"}, ++ {82, "ERESTART", "restart the system call"}, ++ {83, "EPROCLIM", "too many processes"}, ++ {84, "EUSERS", "too many users"}, ++ {85, "ELOOP", "too many levels of symbolic links"}, ++ {86, "ENAMETOOLONG", "file name too long"}, ++ {88, "EDQUOT", "disk quota exceeded"}, ++ {89, "ECORRUPT", "invalid file system control data detected"}, ++ {90, "ESYSERROR", "for future use "}, ++ {93, "EREMOTE", "item is not local to host"}, ++ {94, "ENOTRECOVERABLE", "state not recoverable "}, ++ {95, "EOWNERDEAD", "previous owner died "}, ++ {109, "ENOSYS", "function not implemented"}, ++ {110, "EMEDIA", "media surface error"}, ++ {111, "ESOFT", "I/O completed, but needs relocation"}, ++ {112, "ENOATTR", "no attribute found"}, ++ {113, "ESAD", "security Authentication Denied"}, ++ {114, "ENOTRUST", "not a Trusted Program"}, ++ {115, "ETOOMANYREFS", "too many references: can't splice"}, ++ {116, "EILSEQ", "invalid wide character"}, ++ {117, "ECANCELED", "asynchronous I/O cancelled"}, ++ {118, "ENOSR", "out of STREAMS resources"}, ++ {119, "ETIME", "system call timed out"}, ++ {120, "EBADMSG", "next message has wrong type"}, ++ {121, "EPROTO", "error in protocol"}, ++ {122, "ENODATA", "no message on stream head read q"}, ++ {123, "ENOSTR", "fd not associated with a stream"}, ++ {124, "ENOTSUP", "unsupported attribute value"}, ++ {125, "EMULTIHOP", "multihop is not allowed"}, ++ {126, "ENOLINK", "the server link has been severed"}, ++ {127, "EOVERFLOW", "value too large to be stored in data type"}, ++} ++ ++// Signal table ++var signalList = [...]struct { ++ num syscall.Signal ++ name string ++ desc string ++}{ ++ {1, "SIGHUP", "hangup"}, ++ {2, "SIGINT", "interrupt"}, ++ {3, "SIGQUIT", "quit"}, ++ {4, "SIGILL", "illegal instruction"}, ++ {5, "SIGTRAP", "trace/BPT trap"}, ++ {6, "SIGIOT", "IOT/Abort trap"}, ++ {7, "SIGEMT", "EMT trap"}, ++ {8, "SIGFPE", "floating point exception"}, ++ {9, "SIGKILL", "killed"}, ++ {10, "SIGBUS", "bus error"}, ++ {11, "SIGSEGV", "segmentation fault"}, ++ {12, "SIGSYS", "bad system call"}, ++ {13, "SIGPIPE", "broken pipe"}, ++ {14, "SIGALRM", "alarm clock"}, ++ {15, "SIGTERM", "terminated"}, ++ {16, "SIGURG", "urgent I/O condition"}, ++ {17, "SIGSTOP", "stopped (signal)"}, ++ {18, "SIGTSTP", "stopped"}, ++ {19, "SIGCONT", "continued"}, ++ {20, "SIGCHLD", "child exited"}, ++ {21, "SIGTTIN", "stopped (tty input)"}, ++ {22, "SIGTTOU", "stopped (tty output)"}, ++ {23, "SIGIO", "I/O possible/complete"}, ++ {24, "SIGXCPU", "cputime limit exceeded"}, ++ {25, "SIGXFSZ", "filesize limit exceeded"}, ++ {27, "SIGMSG", "input device data"}, ++ {28, "SIGWINCH", "window size changes"}, ++ {29, "SIGPWR", "power-failure"}, ++ {30, "SIGUSR1", "user defined signal 1"}, ++ {31, "SIGUSR2", "user defined signal 2"}, ++ {32, "SIGPROF", "profiling timer expired"}, ++ {33, "SIGDANGER", "paging space low"}, ++ {34, "SIGVTALRM", "virtual timer expired"}, ++ {35, "SIGMIGRATE", "signal 35"}, ++ {36, "SIGPRE", "signal 36"}, ++ {37, "SIGVIRT", "signal 37"}, ++ {38, "SIGTALRM", "signal 38"}, ++ {39, "SIGWAITING", "signal 39"}, ++ {48, "SIGSYSERROR", "signal 48"}, ++ {49, "SIGCAPI", "signal 49"}, ++ {58, "SIGRECONFIG", "signal 58"}, ++ {59, "SIGCPUFAIL", "CPU Failure Predicted"}, ++ {60, "SIGGRANT", "monitor mode granted"}, ++ {61, "SIGRETRACT", "monitor mode retracted"}, ++ {62, "SIGSOUND", "sound completed"}, ++ {63, "SIGMAX32", "secure attention"}, ++ {255, "SIGMAX", "signal 255"}, ++} +diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go +index 1c68758b..6217cdba 100644 +--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go ++++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go +@@ -3,7 +3,7 @@ + + // +build 386,darwin + +-// Created by cgo -godefs - DO NOT EDIT ++// Code generated by cmd/cgo -godefs; DO NOT EDIT. + // cgo -godefs -- -m32 _const.go + + package unix +@@ -49,6 +49,86 @@ const ( + AF_UNSPEC = 0x0 + AF_UTUN = 0x26 + ALTWERASE = 0x200 ++ ATTR_BIT_MAP_COUNT = 0x5 ++ ATTR_CMN_ACCESSMASK = 0x20000 ++ ATTR_CMN_ACCTIME = 0x1000 ++ ATTR_CMN_ADDEDTIME = 0x10000000 ++ ATTR_CMN_BKUPTIME = 0x2000 ++ ATTR_CMN_CHGTIME = 0x800 ++ ATTR_CMN_CRTIME = 0x200 ++ ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000 ++ ATTR_CMN_DEVID = 0x2 ++ ATTR_CMN_DOCUMENT_ID = 0x100000 ++ ATTR_CMN_ERROR = 0x20000000 ++ ATTR_CMN_EXTENDED_SECURITY = 0x400000 ++ ATTR_CMN_FILEID = 0x2000000 ++ ATTR_CMN_FLAGS = 0x40000 ++ ATTR_CMN_FNDRINFO = 0x4000 ++ ATTR_CMN_FSID = 0x4 ++ ATTR_CMN_FULLPATH = 0x8000000 ++ ATTR_CMN_GEN_COUNT = 0x80000 ++ ATTR_CMN_GRPID = 0x10000 ++ ATTR_CMN_GRPUUID = 0x1000000 ++ ATTR_CMN_MODTIME = 0x400 ++ ATTR_CMN_NAME = 0x1 ++ ATTR_CMN_NAMEDATTRCOUNT = 0x80000 ++ ATTR_CMN_NAMEDATTRLIST = 0x100000 ++ ATTR_CMN_OBJID = 0x20 ++ ATTR_CMN_OBJPERMANENTID = 0x40 ++ ATTR_CMN_OBJTAG = 0x10 ++ ATTR_CMN_OBJTYPE = 0x8 ++ ATTR_CMN_OWNERID = 0x8000 ++ ATTR_CMN_PARENTID = 0x4000000 ++ ATTR_CMN_PAROBJID = 0x80 ++ ATTR_CMN_RETURNED_ATTRS = 0x80000000 ++ ATTR_CMN_SCRIPT = 0x100 ++ ATTR_CMN_SETMASK = 0x41c7ff00 ++ ATTR_CMN_USERACCESS = 0x200000 ++ ATTR_CMN_UUID = 0x800000 ++ ATTR_CMN_VALIDMASK = 0xffffffff ++ ATTR_CMN_VOLSETMASK = 0x6700 ++ ATTR_FILE_ALLOCSIZE = 0x4 ++ ATTR_FILE_CLUMPSIZE = 0x10 ++ ATTR_FILE_DATAALLOCSIZE = 0x400 ++ ATTR_FILE_DATAEXTENTS = 0x800 ++ ATTR_FILE_DATALENGTH = 0x200 ++ ATTR_FILE_DEVTYPE = 0x20 ++ ATTR_FILE_FILETYPE = 0x40 ++ ATTR_FILE_FORKCOUNT = 0x80 ++ ATTR_FILE_FORKLIST = 0x100 ++ ATTR_FILE_IOBLOCKSIZE = 0x8 ++ ATTR_FILE_LINKCOUNT = 0x1 ++ ATTR_FILE_RSRCALLOCSIZE = 0x2000 ++ ATTR_FILE_RSRCEXTENTS = 0x4000 ++ ATTR_FILE_RSRCLENGTH = 0x1000 ++ ATTR_FILE_SETMASK = 0x20 ++ ATTR_FILE_TOTALSIZE = 0x2 ++ ATTR_FILE_VALIDMASK = 0x37ff ++ ATTR_VOL_ALLOCATIONCLUMP = 0x40 ++ ATTR_VOL_ATTRIBUTES = 0x40000000 ++ ATTR_VOL_CAPABILITIES = 0x20000 ++ ATTR_VOL_DIRCOUNT = 0x400 ++ ATTR_VOL_ENCODINGSUSED = 0x10000 ++ ATTR_VOL_FILECOUNT = 0x200 ++ ATTR_VOL_FSTYPE = 0x1 ++ ATTR_VOL_INFO = 0x80000000 ++ ATTR_VOL_IOBLOCKSIZE = 0x80 ++ ATTR_VOL_MAXOBJCOUNT = 0x800 ++ ATTR_VOL_MINALLOCATION = 0x20 ++ ATTR_VOL_MOUNTEDDEVICE = 0x8000 ++ ATTR_VOL_MOUNTFLAGS = 0x4000 ++ ATTR_VOL_MOUNTPOINT = 0x1000 ++ ATTR_VOL_NAME = 0x2000 ++ ATTR_VOL_OBJCOUNT = 0x100 ++ ATTR_VOL_QUOTA_SIZE = 0x10000000 ++ ATTR_VOL_RESERVED_SIZE = 0x20000000 ++ ATTR_VOL_SETMASK = 0x80002000 ++ ATTR_VOL_SIGNATURE = 0x2 ++ ATTR_VOL_SIZE = 0x4 ++ ATTR_VOL_SPACEAVAIL = 0x10 ++ ATTR_VOL_SPACEFREE = 0x8 ++ ATTR_VOL_UUID = 0x40000 ++ ATTR_VOL_VALIDMASK = 0xf007ffff + B0 = 0x0 + B110 = 0x6e + B115200 = 0x1c200 +@@ -169,6 +249,8 @@ const ( + CSTOP = 0x13 + CSTOPB = 0x400 + CSUSP = 0x1a ++ CTL_HW = 0x6 ++ CTL_KERN = 0x1 + CTL_MAXNAME = 0xc + CTL_NET = 0x4 + DLT_A429 = 0xb8 +@@ -390,6 +472,11 @@ const ( + FF1 = 0x4000 + FFDLY = 0x4000 + FLUSHO = 0x800000 ++ FSOPT_ATTR_CMN_EXTENDED = 0x20 ++ FSOPT_NOFOLLOW = 0x1 ++ FSOPT_NOINMEMUPDATE = 0x2 ++ FSOPT_PACK_INVAL_ATTRS = 0x8 ++ FSOPT_REPORT_FULLSIZE = 0x4 + F_ADDFILESIGS = 0x3d + F_ADDFILESIGS_FOR_DYLD_SIM = 0x53 + F_ADDFILESIGS_RETURN = 0x61 +@@ -425,6 +512,7 @@ const ( + F_PATHPKG_CHECK = 0x34 + F_PEOFPOSMODE = 0x3 + F_PREALLOCATE = 0x2a ++ F_PUNCHHOLE = 0x63 + F_RDADVISE = 0x2c + F_RDAHEAD = 0x2d + F_RDLCK = 0x1 +@@ -441,10 +529,12 @@ const ( + F_SINGLE_WRITER = 0x4c + F_THAW_FS = 0x36 + F_TRANSCODEKEY = 0x4b ++ F_TRIM_ACTIVE_FILE = 0x64 + F_UNLCK = 0x2 + F_VOLPOSMODE = 0x4 + F_WRLCK = 0x3 + HUPCL = 0x4000 ++ HW_MACHINE = 0x1 + ICANON = 0x100 + ICMP6_FILTER = 0x12 + ICRNL = 0x100 +@@ -681,6 +771,7 @@ const ( + IPV6_FAITH = 0x1d + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 ++ IPV6_FLOW_ECN_MASK = 0x300 + IPV6_FRAGTTL = 0x3c + IPV6_FW_ADD = 0x1e + IPV6_FW_DEL = 0x1f +@@ -771,6 +862,7 @@ const ( + IP_RECVOPTS = 0x5 + IP_RECVPKTINFO = 0x1a + IP_RECVRETOPTS = 0x6 ++ IP_RECVTOS = 0x1b + IP_RECVTTL = 0x18 + IP_RETOPTS = 0x8 + IP_RF = 0x8000 +@@ -789,6 +881,10 @@ const ( + 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 +@@ -884,6 +980,7 @@ const ( + NET_RT_MAXID = 0xa + NET_RT_STAT = 0x4 + NET_RT_TRASH = 0x5 ++ NFDBITS = 0x20 + NL0 = 0x0 + NL1 = 0x100 + NL2 = 0x200 +@@ -1377,6 +1474,12 @@ const ( + WORDSIZE = 0x20 + WSTOPPED = 0x8 + WUNTRACED = 0x2 ++ XATTR_CREATE = 0x2 ++ XATTR_NODEFAULT = 0x10 ++ XATTR_NOFOLLOW = 0x1 ++ XATTR_NOSECURITY = 0x8 ++ XATTR_REPLACE = 0x4 ++ XATTR_SHOWCOMPRESSION = 0x20 + ) + + // Errors +@@ -1528,146 +1631,154 @@ const ( + ) + + // Error table +-var errors = [...]string{ +- 1: "operation not permitted", +- 2: "no such file or directory", +- 3: "no such process", +- 4: "interrupted system call", +- 5: "input/output error", +- 6: "device not configured", +- 7: "argument list too long", +- 8: "exec format error", +- 9: "bad file descriptor", +- 10: "no child processes", +- 11: "resource deadlock avoided", +- 12: "cannot allocate memory", +- 13: "permission denied", +- 14: "bad address", +- 15: "block device required", +- 16: "resource busy", +- 17: "file exists", +- 18: "cross-device link", +- 19: "operation not supported by device", +- 20: "not a directory", +- 21: "is a directory", +- 22: "invalid argument", +- 23: "too many open files in system", +- 24: "too many open files", +- 25: "inappropriate ioctl for device", +- 26: "text file busy", +- 27: "file too large", +- 28: "no space left on device", +- 29: "illegal seek", +- 30: "read-only file system", +- 31: "too many links", +- 32: "broken pipe", +- 33: "numerical argument out of domain", +- 34: "result too large", +- 35: "resource temporarily unavailable", +- 36: "operation now in progress", +- 37: "operation already in progress", +- 38: "socket operation on non-socket", +- 39: "destination address required", +- 40: "message too long", +- 41: "protocol wrong type for socket", +- 42: "protocol not available", +- 43: "protocol not supported", +- 44: "socket type not supported", +- 45: "operation not supported", +- 46: "protocol family not supported", +- 47: "address family not supported by protocol family", +- 48: "address already in use", +- 49: "can't assign requested address", +- 50: "network is down", +- 51: "network is unreachable", +- 52: "network dropped connection on reset", +- 53: "software caused connection abort", +- 54: "connection reset by peer", +- 55: "no buffer space available", +- 56: "socket is already connected", +- 57: "socket is not connected", +- 58: "can't send after socket shutdown", +- 59: "too many references: can't splice", +- 60: "operation timed out", +- 61: "connection refused", +- 62: "too many levels of symbolic links", +- 63: "file name too long", +- 64: "host is down", +- 65: "no route to host", +- 66: "directory not empty", +- 67: "too many processes", +- 68: "too many users", +- 69: "disc quota exceeded", +- 70: "stale NFS file handle", +- 71: "too many levels of remote in path", +- 72: "RPC struct is bad", +- 73: "RPC version wrong", +- 74: "RPC prog. not avail", +- 75: "program version wrong", +- 76: "bad procedure for program", +- 77: "no locks available", +- 78: "function not implemented", +- 79: "inappropriate file type or format", +- 80: "authentication error", +- 81: "need authenticator", +- 82: "device power is off", +- 83: "device error", +- 84: "value too large to be stored in data type", +- 85: "bad executable (or shared library)", +- 86: "bad CPU type in executable", +- 87: "shared library version mismatch", +- 88: "malformed Mach-o file", +- 89: "operation canceled", +- 90: "identifier removed", +- 91: "no message of desired type", +- 92: "illegal byte sequence", +- 93: "attribute not found", +- 94: "bad message", +- 95: "EMULTIHOP (Reserved)", +- 96: "no message available on STREAM", +- 97: "ENOLINK (Reserved)", +- 98: "no STREAM resources", +- 99: "not a STREAM", +- 100: "protocol error", +- 101: "STREAM ioctl timeout", +- 102: "operation not supported on socket", +- 103: "policy not found", +- 104: "state not recoverable", +- 105: "previous owner died", +- 106: "interface output queue is full", ++var errorList = [...]struct { ++ num syscall.Errno ++ name string ++ desc string ++}{ ++ {1, "EPERM", "operation not permitted"}, ++ {2, "ENOENT", "no such file or directory"}, ++ {3, "ESRCH", "no such process"}, ++ {4, "EINTR", "interrupted system call"}, ++ {5, "EIO", "input/output error"}, ++ {6, "ENXIO", "device not configured"}, ++ {7, "E2BIG", "argument list too long"}, ++ {8, "ENOEXEC", "exec format error"}, ++ {9, "EBADF", "bad file descriptor"}, ++ {10, "ECHILD", "no child processes"}, ++ {11, "EDEADLK", "resource deadlock avoided"}, ++ {12, "ENOMEM", "cannot allocate memory"}, ++ {13, "EACCES", "permission denied"}, ++ {14, "EFAULT", "bad address"}, ++ {15, "ENOTBLK", "block device required"}, ++ {16, "EBUSY", "resource busy"}, ++ {17, "EEXIST", "file exists"}, ++ {18, "EXDEV", "cross-device link"}, ++ {19, "ENODEV", "operation not supported by device"}, ++ {20, "ENOTDIR", "not a directory"}, ++ {21, "EISDIR", "is a directory"}, ++ {22, "EINVAL", "invalid argument"}, ++ {23, "ENFILE", "too many open files in system"}, ++ {24, "EMFILE", "too many open files"}, ++ {25, "ENOTTY", "inappropriate ioctl for device"}, ++ {26, "ETXTBSY", "text file busy"}, ++ {27, "EFBIG", "file too large"}, ++ {28, "ENOSPC", "no space left on device"}, ++ {29, "ESPIPE", "illegal seek"}, ++ {30, "EROFS", "read-only file system"}, ++ {31, "EMLINK", "too many links"}, ++ {32, "EPIPE", "broken pipe"}, ++ {33, "EDOM", "numerical argument out of domain"}, ++ {34, "ERANGE", "result too large"}, ++ {35, "EAGAIN", "resource temporarily unavailable"}, ++ {36, "EINPROGRESS", "operation now in progress"}, ++ {37, "EALREADY", "operation already in progress"}, ++ {38, "ENOTSOCK", "socket operation on non-socket"}, ++ {39, "EDESTADDRREQ", "destination address required"}, ++ {40, "EMSGSIZE", "message too long"}, ++ {41, "EPROTOTYPE", "protocol wrong type for socket"}, ++ {42, "ENOPROTOOPT", "protocol not available"}, ++ {43, "EPROTONOSUPPORT", "protocol not supported"}, ++ {44, "ESOCKTNOSUPPORT", "socket type not supported"}, ++ {45, "ENOTSUP", "operation not supported"}, ++ {46, "EPFNOSUPPORT", "protocol family not supported"}, ++ {47, "EAFNOSUPPORT", "address family not supported by protocol family"}, ++ {48, "EADDRINUSE", "address already in use"}, ++ {49, "EADDRNOTAVAIL", "can't assign requested address"}, ++ {50, "ENETDOWN", "network is down"}, ++ {51, "ENETUNREACH", "network is unreachable"}, ++ {52, "ENETRESET", "network dropped connection on reset"}, ++ {53, "ECONNABORTED", "software caused connection abort"}, ++ {54, "ECONNRESET", "connection reset by peer"}, ++ {55, "ENOBUFS", "no buffer space available"}, ++ {56, "EISCONN", "socket is already connected"}, ++ {57, "ENOTCONN", "socket is not connected"}, ++ {58, "ESHUTDOWN", "can't send after socket shutdown"}, ++ {59, "ETOOMANYREFS", "too many references: can't splice"}, ++ {60, "ETIMEDOUT", "operation timed out"}, ++ {61, "ECONNREFUSED", "connection refused"}, ++ {62, "ELOOP", "too many levels of symbolic links"}, ++ {63, "ENAMETOOLONG", "file name too long"}, ++ {64, "EHOSTDOWN", "host is down"}, ++ {65, "EHOSTUNREACH", "no route to host"}, ++ {66, "ENOTEMPTY", "directory not empty"}, ++ {67, "EPROCLIM", "too many processes"}, ++ {68, "EUSERS", "too many users"}, ++ {69, "EDQUOT", "disc quota exceeded"}, ++ {70, "ESTALE", "stale NFS file handle"}, ++ {71, "EREMOTE", "too many levels of remote in path"}, ++ {72, "EBADRPC", "RPC struct is bad"}, ++ {73, "ERPCMISMATCH", "RPC version wrong"}, ++ {74, "EPROGUNAVAIL", "RPC prog. not avail"}, ++ {75, "EPROGMISMATCH", "program version wrong"}, ++ {76, "EPROCUNAVAIL", "bad procedure for program"}, ++ {77, "ENOLCK", "no locks available"}, ++ {78, "ENOSYS", "function not implemented"}, ++ {79, "EFTYPE", "inappropriate file type or format"}, ++ {80, "EAUTH", "authentication error"}, ++ {81, "ENEEDAUTH", "need authenticator"}, ++ {82, "EPWROFF", "device power is off"}, ++ {83, "EDEVERR", "device error"}, ++ {84, "EOVERFLOW", "value too large to be stored in data type"}, ++ {85, "EBADEXEC", "bad executable (or shared library)"}, ++ {86, "EBADARCH", "bad CPU type in executable"}, ++ {87, "ESHLIBVERS", "shared library version mismatch"}, ++ {88, "EBADMACHO", "malformed Mach-o file"}, ++ {89, "ECANCELED", "operation canceled"}, ++ {90, "EIDRM", "identifier removed"}, ++ {91, "ENOMSG", "no message of desired type"}, ++ {92, "EILSEQ", "illegal byte sequence"}, ++ {93, "ENOATTR", "attribute not found"}, ++ {94, "EBADMSG", "bad message"}, ++ {95, "EMULTIHOP", "EMULTIHOP (Reserved)"}, ++ {96, "ENODATA", "no message available on STREAM"}, ++ {97, "ENOLINK", "ENOLINK (Reserved)"}, ++ {98, "ENOSR", "no STREAM resources"}, ++ {99, "ENOSTR", "not a STREAM"}, ++ {100, "EPROTO", "protocol error"}, ++ {101, "ETIME", "STREAM ioctl timeout"}, ++ {102, "EOPNOTSUPP", "operation not supported on socket"}, ++ {103, "ENOPOLICY", "policy not found"}, ++ {104, "ENOTRECOVERABLE", "state not recoverable"}, ++ {105, "EOWNERDEAD", "previous owner died"}, ++ {106, "EQFULL", "interface output queue is full"}, + } + + // Signal table +-var signals = [...]string{ +- 1: "hangup", +- 2: "interrupt", +- 3: "quit", +- 4: "illegal instruction", +- 5: "trace/BPT trap", +- 6: "abort trap", +- 7: "EMT trap", +- 8: "floating point exception", +- 9: "killed", +- 10: "bus error", +- 11: "segmentation fault", +- 12: "bad system call", +- 13: "broken pipe", +- 14: "alarm clock", +- 15: "terminated", +- 16: "urgent I/O condition", +- 17: "suspended (signal)", +- 18: "suspended", +- 19: "continued", +- 20: "child exited", +- 21: "stopped (tty input)", +- 22: "stopped (tty output)", +- 23: "I/O possible", +- 24: "cputime limit exceeded", +- 25: "filesize limit exceeded", +- 26: "virtual timer expired", +- 27: "profiling timer expired", +- 28: "window size changes", +- 29: "information request", +- 30: "user defined signal 1", +- 31: "user defined signal 2", ++var signalList = [...]struct { ++ num syscall.Signal ++ name string ++ desc string ++}{ ++ {1, "SIGHUP", "hangup"}, ++ {2, "SIGINT", "interrupt"}, ++ {3, "SIGQUIT", "quit"}, ++ {4, "SIGILL", "illegal instruction"}, ++ {5, "SIGTRAP", "trace/BPT trap"}, ++ {6, "SIGABRT", "abort trap"}, ++ {7, "SIGEMT", "EMT trap"}, ++ {8, "SIGFPE", "floating point exception"}, ++ {9, "SIGKILL", "killed"}, ++ {10, "SIGBUS", "bus error"}, ++ {11, "SIGSEGV", "segmentation fault"}, ++ {12, "SIGSYS", "bad system call"}, ++ {13, "SIGPIPE", "broken pipe"}, ++ {14, "SIGALRM", "alarm clock"}, ++ {15, "SIGTERM", "terminated"}, ++ {16, "SIGURG", "urgent I/O condition"}, ++ {17, "SIGSTOP", "suspended (signal)"}, ++ {18, "SIGTSTP", "suspended"}, ++ {19, "SIGCONT", "continued"}, ++ {20, "SIGCHLD", "child exited"}, ++ {21, "SIGTTIN", "stopped (tty input)"}, ++ {22, "SIGTTOU", "stopped (tty output)"}, ++ {23, "SIGIO", "I/O possible"}, ++ {24, "SIGXCPU", "cputime limit exceeded"}, ++ {25, "SIGXFSZ", "filesize limit exceeded"}, ++ {26, "SIGVTALRM", "virtual timer expired"}, ++ {27, "SIGPROF", "profiling timer expired"}, ++ {28, "SIGWINCH", "window size changes"}, ++ {29, "SIGINFO", "information request"}, ++ {30, "SIGUSR1", "user defined signal 1"}, ++ {31, "SIGUSR2", "user defined signal 2"}, + } +diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +index 48f63d4f..e3ff2ee3 100644 +--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go ++++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +@@ -3,7 +3,7 @@ + + // +build amd64,darwin + +-// Created by cgo -godefs - DO NOT EDIT ++// Code generated by cmd/cgo -godefs; DO NOT EDIT. + // cgo -godefs -- -m64 _const.go + + package unix +@@ -49,6 +49,86 @@ const ( + AF_UNSPEC = 0x0 + AF_UTUN = 0x26 + ALTWERASE = 0x200 ++ ATTR_BIT_MAP_COUNT = 0x5 ++ ATTR_CMN_ACCESSMASK = 0x20000 ++ ATTR_CMN_ACCTIME = 0x1000 ++ ATTR_CMN_ADDEDTIME = 0x10000000 ++ ATTR_CMN_BKUPTIME = 0x2000 ++ ATTR_CMN_CHGTIME = 0x800 ++ ATTR_CMN_CRTIME = 0x200 ++ ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000 ++ ATTR_CMN_DEVID = 0x2 ++ ATTR_CMN_DOCUMENT_ID = 0x100000 ++ ATTR_CMN_ERROR = 0x20000000 ++ ATTR_CMN_EXTENDED_SECURITY = 0x400000 ++ ATTR_CMN_FILEID = 0x2000000 ++ ATTR_CMN_FLAGS = 0x40000 ++ ATTR_CMN_FNDRINFO = 0x4000 ++ ATTR_CMN_FSID = 0x4 ++ ATTR_CMN_FULLPATH = 0x8000000 ++ ATTR_CMN_GEN_COUNT = 0x80000 ++ ATTR_CMN_GRPID = 0x10000 ++ ATTR_CMN_GRPUUID = 0x1000000 ++ ATTR_CMN_MODTIME = 0x400 ++ ATTR_CMN_NAME = 0x1 ++ ATTR_CMN_NAMEDATTRCOUNT = 0x80000 ++ ATTR_C |