├── .github
├── FUNDING.yml
└── workflows
│ ├── antispam.yml
│ ├── pr.yml
│ └── release.yml
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── cmd
├── pack
│ └── main.go
└── traitor
│ └── main.go
├── demo.gif
├── go.mod
├── go.sum
├── internal
├── cmd
│ ├── backdoor.go
│ ├── list.go
│ ├── root.go
│ └── setuid.go
├── pipe
│ └── pipe.go
└── version
│ └── version.go
├── pkg
├── backdoor
│ └── traitor.go
├── exploits
│ ├── all.go
│ ├── cve20213560
│ │ └── exploit.go
│ ├── cve20214034
│ │ ├── exploit.go
│ │ ├── sharedobject_sh_386.go
│ │ ├── sharedobject_sh_amd64.go
│ │ ├── sharedobject_sh_arm64.go
│ │ ├── sharedobject_true_386.go
│ │ ├── sharedobject_true_amd64.go
│ │ └── sharedobject_true_arm64.go
│ ├── cve20220847
│ │ └── exploit.go
│ ├── dockersock
│ │ └── exploit.go
│ ├── gtfobins.go
│ ├── registration.go
│ └── types.go
├── logger
│ └── logger.go
├── payloads
│ └── payloads.go
├── random
│ └── filename.go
├── shell
│ └── password.go
└── state
│ ├── distro.go
│ ├── kernel.go
│ ├── packages.go
│ ├── state.go
│ └── sudoers.go
├── polkit.png
└── vendor
├── github.com
├── creack
│ └── pty
│ │ ├── .gitignore
│ │ ├── Dockerfile.golang
│ │ ├── Dockerfile.riscv
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── asm_solaris_amd64.s
│ │ ├── doc.go
│ │ ├── ioctl.go
│ │ ├── ioctl_bsd.go
│ │ ├── ioctl_solaris.go
│ │ ├── ioctl_unsupported.go
│ │ ├── mktypes.bash
│ │ ├── pty_darwin.go
│ │ ├── pty_dragonfly.go
│ │ ├── pty_freebsd.go
│ │ ├── pty_linux.go
│ │ ├── pty_netbsd.go
│ │ ├── pty_openbsd.go
│ │ ├── pty_solaris.go
│ │ ├── pty_unsupported.go
│ │ ├── run.go
│ │ ├── start.go
│ │ ├── start_windows.go
│ │ ├── test_crosscompile.sh
│ │ ├── winsize.go
│ │ ├── winsize_unix.go
│ │ ├── winsize_unsupported.go
│ │ ├── ztypes_386.go
│ │ ├── ztypes_amd64.go
│ │ ├── ztypes_arm.go
│ │ ├── ztypes_arm64.go
│ │ ├── ztypes_dragonfly_amd64.go
│ │ ├── ztypes_freebsd_386.go
│ │ ├── ztypes_freebsd_amd64.go
│ │ ├── ztypes_freebsd_arm.go
│ │ ├── ztypes_freebsd_arm64.go
│ │ ├── ztypes_freebsd_ppc64.go
│ │ ├── ztypes_loong64.go
│ │ ├── ztypes_mipsx.go
│ │ ├── ztypes_netbsd_32bit_int.go
│ │ ├── ztypes_openbsd_32bit_int.go
│ │ ├── ztypes_ppc64.go
│ │ ├── ztypes_ppc64le.go
│ │ ├── ztypes_riscvx.go
│ │ └── ztypes_s390x.go
├── google
│ └── uuid
│ │ ├── .travis.yml
│ │ ├── CONTRIBUTING.md
│ │ ├── CONTRIBUTORS
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── dce.go
│ │ ├── doc.go
│ │ ├── hash.go
│ │ ├── marshal.go
│ │ ├── node.go
│ │ ├── node_js.go
│ │ ├── node_net.go
│ │ ├── null.go
│ │ ├── sql.go
│ │ ├── time.go
│ │ ├── util.go
│ │ ├── uuid.go
│ │ ├── version1.go
│ │ └── version4.go
├── hashicorp
│ └── go-version
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── constraint.go
│ │ ├── version.go
│ │ └── version_collection.go
├── inconshreveable
│ └── mousetrap
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── trap_others.go
│ │ ├── trap_windows.go
│ │ └── trap_windows_1.4.go
├── liamg
│ └── tml
│ │ ├── .gitignore
│ │ ├── .travis.yml
│ │ ├── LICENSE
│ │ ├── Makefile
│ │ ├── README.md
│ │ ├── disable.go
│ │ ├── example.png
│ │ ├── new_line.go
│ │ ├── parse.go
│ │ ├── parser.go
│ │ ├── printf.go
│ │ ├── println.go
│ │ ├── sprintf.go
│ │ └── tags.go
└── spf13
│ ├── cobra
│ ├── .gitignore
│ ├── .golangci.yml
│ ├── .mailmap
│ ├── CONDUCT.md
│ ├── CONTRIBUTING.md
│ ├── LICENSE.txt
│ ├── MAINTAINERS
│ ├── Makefile
│ ├── README.md
│ ├── active_help.go
│ ├── active_help.md
│ ├── args.go
│ ├── bash_completions.go
│ ├── bash_completions.md
│ ├── bash_completionsV2.go
│ ├── cobra.go
│ ├── command.go
│ ├── command_notwin.go
│ ├── command_win.go
│ ├── completions.go
│ ├── fish_completions.go
│ ├── fish_completions.md
│ ├── flag_groups.go
│ ├── powershell_completions.go
│ ├── powershell_completions.md
│ ├── projects_using_cobra.md
│ ├── shell_completions.go
│ ├── shell_completions.md
│ ├── user_guide.md
│ ├── zsh_completions.go
│ └── zsh_completions.md
│ └── pflag
│ ├── .gitignore
│ ├── .travis.yml
│ ├── LICENSE
│ ├── README.md
│ ├── bool.go
│ ├── bool_slice.go
│ ├── bytes.go
│ ├── count.go
│ ├── duration.go
│ ├── duration_slice.go
│ ├── flag.go
│ ├── float32.go
│ ├── float32_slice.go
│ ├── float64.go
│ ├── float64_slice.go
│ ├── golangflag.go
│ ├── int.go
│ ├── int16.go
│ ├── int32.go
│ ├── int32_slice.go
│ ├── int64.go
│ ├── int64_slice.go
│ ├── int8.go
│ ├── int_slice.go
│ ├── ip.go
│ ├── ip_slice.go
│ ├── ipmask.go
│ ├── ipnet.go
│ ├── string.go
│ ├── string_array.go
│ ├── string_slice.go
│ ├── string_to_int.go
│ ├── string_to_int64.go
│ ├── string_to_string.go
│ ├── uint.go
│ ├── uint16.go
│ ├── uint32.go
│ ├── uint64.go
│ ├── uint8.go
│ └── uint_slice.go
├── golang.org
└── x
│ ├── crypto
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ └── ssh
│ │ └── terminal
│ │ └── terminal.go
│ ├── sys
│ ├── AUTHORS
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── internal
│ │ └── unsafeheader
│ │ │ └── unsafeheader.go
│ ├── plan9
│ │ ├── asm.s
│ │ ├── asm_plan9_386.s
│ │ ├── asm_plan9_amd64.s
│ │ ├── asm_plan9_arm.s
│ │ ├── const_plan9.go
│ │ ├── dir_plan9.go
│ │ ├── env_plan9.go
│ │ ├── errors_plan9.go
│ │ ├── mkall.sh
│ │ ├── mkerrors.sh
│ │ ├── mksysnum_plan9.sh
│ │ ├── pwd_go15_plan9.go
│ │ ├── pwd_plan9.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_plan9.go
│ │ ├── zsyscall_plan9_386.go
│ │ ├── zsyscall_plan9_amd64.go
│ │ ├── zsyscall_plan9_arm.go
│ │ └── zsysnum_plan9.go
│ ├── unix
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── affinity_linux.go
│ │ ├── aliases.go
│ │ ├── asm_aix_ppc64.s
│ │ ├── asm_bsd_386.s
│ │ ├── asm_bsd_amd64.s
│ │ ├── asm_bsd_arm.s
│ │ ├── asm_bsd_arm64.s
│ │ ├── asm_linux_386.s
│ │ ├── asm_linux_amd64.s
│ │ ├── asm_linux_arm.s
│ │ ├── asm_linux_arm64.s
│ │ ├── asm_linux_loong64.s
│ │ ├── asm_linux_mips64x.s
│ │ ├── asm_linux_mipsx.s
│ │ ├── asm_linux_ppc64x.s
│ │ ├── asm_linux_riscv64.s
│ │ ├── asm_linux_s390x.s
│ │ ├── asm_openbsd_mips64.s
│ │ ├── asm_solaris_amd64.s
│ │ ├── asm_zos_s390x.s
│ │ ├── bluetooth_linux.go
│ │ ├── cap_freebsd.go
│ │ ├── constants.go
│ │ ├── dev_aix_ppc.go
│ │ ├── dev_aix_ppc64.go
│ │ ├── dev_darwin.go
│ │ ├── dev_dragonfly.go
│ │ ├── dev_freebsd.go
│ │ ├── dev_linux.go
│ │ ├── dev_netbsd.go
│ │ ├── dev_openbsd.go
│ │ ├── dev_zos.go
│ │ ├── dirent.go
│ │ ├── endian_big.go
│ │ ├── endian_little.go
│ │ ├── env_unix.go
│ │ ├── epoll_zos.go
│ │ ├── errors_freebsd_386.go
│ │ ├── errors_freebsd_amd64.go
│ │ ├── errors_freebsd_arm.go
│ │ ├── errors_freebsd_arm64.go
│ │ ├── fcntl.go
│ │ ├── fcntl_darwin.go
│ │ ├── fcntl_linux_32bit.go
│ │ ├── fdset.go
│ │ ├── fstatfs_zos.go
│ │ ├── gccgo.go
│ │ ├── gccgo_c.c
│ │ ├── gccgo_linux_amd64.go
│ │ ├── ifreq_linux.go
│ │ ├── ioctl.go
│ │ ├── ioctl_linux.go
│ │ ├── ioctl_zos.go
│ │ ├── mkall.sh
│ │ ├── mkerrors.sh
│ │ ├── pagesize_unix.go
│ │ ├── pledge_openbsd.go
│ │ ├── ptrace_darwin.go
│ │ ├── ptrace_ios.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── readdirent_getdents.go
│ │ ├── readdirent_getdirentries.go
│ │ ├── sockcmsg_dragonfly.go
│ │ ├── sockcmsg_linux.go
│ │ ├── sockcmsg_unix.go
│ │ ├── sockcmsg_unix_other.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_aix.go
│ │ ├── syscall_aix_ppc.go
│ │ ├── syscall_aix_ppc64.go
│ │ ├── syscall_bsd.go
│ │ ├── syscall_darwin.1_12.go
│ │ ├── syscall_darwin.1_13.go
│ │ ├── syscall_darwin.go
│ │ ├── syscall_darwin_amd64.go
│ │ ├── syscall_darwin_arm64.go
│ │ ├── syscall_darwin_libSystem.go
│ │ ├── syscall_dragonfly.go
│ │ ├── syscall_dragonfly_amd64.go
│ │ ├── syscall_freebsd.go
│ │ ├── syscall_freebsd_386.go
│ │ ├── syscall_freebsd_amd64.go
│ │ ├── syscall_freebsd_arm.go
│ │ ├── syscall_freebsd_arm64.go
│ │ ├── syscall_illumos.go
│ │ ├── syscall_linux.go
│ │ ├── syscall_linux_386.go
│ │ ├── syscall_linux_alarm.go
│ │ ├── syscall_linux_amd64.go
│ │ ├── syscall_linux_amd64_gc.go
│ │ ├── syscall_linux_arm.go
│ │ ├── syscall_linux_arm64.go
│ │ ├── syscall_linux_gc.go
│ │ ├── syscall_linux_gc_386.go
│ │ ├── syscall_linux_gc_arm.go
│ │ ├── syscall_linux_gccgo_386.go
│ │ ├── syscall_linux_gccgo_arm.go
│ │ ├── syscall_linux_loong64.go
│ │ ├── syscall_linux_mips64x.go
│ │ ├── syscall_linux_mipsx.go
│ │ ├── syscall_linux_ppc.go
│ │ ├── syscall_linux_ppc64x.go
│ │ ├── syscall_linux_riscv64.go
│ │ ├── syscall_linux_s390x.go
│ │ ├── syscall_linux_sparc64.go
│ │ ├── syscall_netbsd.go
│ │ ├── syscall_netbsd_386.go
│ │ ├── syscall_netbsd_amd64.go
│ │ ├── syscall_netbsd_arm.go
│ │ ├── syscall_netbsd_arm64.go
│ │ ├── syscall_openbsd.go
│ │ ├── syscall_openbsd_386.go
│ │ ├── syscall_openbsd_amd64.go
│ │ ├── syscall_openbsd_arm.go
│ │ ├── syscall_openbsd_arm64.go
│ │ ├── syscall_openbsd_mips64.go
│ │ ├── syscall_solaris.go
│ │ ├── syscall_solaris_amd64.go
│ │ ├── syscall_unix.go
│ │ ├── syscall_unix_gc.go
│ │ ├── syscall_unix_gc_ppc64x.go
│ │ ├── syscall_zos_s390x.go
│ │ ├── sysvshm_linux.go
│ │ ├── sysvshm_unix.go
│ │ ├── sysvshm_unix_other.go
│ │ ├── timestruct.go
│ │ ├── unveil_openbsd.go
│ │ ├── xattr_bsd.go
│ │ ├── zerrors_aix_ppc.go
│ │ ├── zerrors_aix_ppc64.go
│ │ ├── zerrors_darwin_amd64.go
│ │ ├── zerrors_darwin_arm64.go
│ │ ├── zerrors_dragonfly_amd64.go
│ │ ├── zerrors_freebsd_386.go
│ │ ├── zerrors_freebsd_amd64.go
│ │ ├── zerrors_freebsd_arm.go
│ │ ├── zerrors_freebsd_arm64.go
│ │ ├── zerrors_linux.go
│ │ ├── zerrors_linux_386.go
│ │ ├── zerrors_linux_amd64.go
│ │ ├── zerrors_linux_arm.go
│ │ ├── zerrors_linux_arm64.go
│ │ ├── zerrors_linux_loong64.go
│ │ ├── zerrors_linux_mips.go
│ │ ├── zerrors_linux_mips64.go
│ │ ├── zerrors_linux_mips64le.go
│ │ ├── zerrors_linux_mipsle.go
│ │ ├── zerrors_linux_ppc.go
│ │ ├── zerrors_linux_ppc64.go
│ │ ├── zerrors_linux_ppc64le.go
│ │ ├── zerrors_linux_riscv64.go
│ │ ├── zerrors_linux_s390x.go
│ │ ├── zerrors_linux_sparc64.go
│ │ ├── zerrors_netbsd_386.go
│ │ ├── zerrors_netbsd_amd64.go
│ │ ├── zerrors_netbsd_arm.go
│ │ ├── zerrors_netbsd_arm64.go
│ │ ├── zerrors_openbsd_386.go
│ │ ├── zerrors_openbsd_amd64.go
│ │ ├── zerrors_openbsd_arm.go
│ │ ├── zerrors_openbsd_arm64.go
│ │ ├── zerrors_openbsd_mips64.go
│ │ ├── zerrors_solaris_amd64.go
│ │ ├── zerrors_zos_s390x.go
│ │ ├── zptrace_armnn_linux.go
│ │ ├── zptrace_linux_arm64.go
│ │ ├── zptrace_mipsnn_linux.go
│ │ ├── zptrace_mipsnnle_linux.go
│ │ ├── zptrace_x86_linux.go
│ │ ├── zsyscall_aix_ppc.go
│ │ ├── zsyscall_aix_ppc64.go
│ │ ├── zsyscall_aix_ppc64_gc.go
│ │ ├── zsyscall_aix_ppc64_gccgo.go
│ │ ├── zsyscall_darwin_amd64.1_13.go
│ │ ├── zsyscall_darwin_amd64.1_13.s
│ │ ├── zsyscall_darwin_amd64.go
│ │ ├── zsyscall_darwin_amd64.s
│ │ ├── zsyscall_darwin_arm64.1_13.go
│ │ ├── zsyscall_darwin_arm64.1_13.s
│ │ ├── zsyscall_darwin_arm64.go
│ │ ├── zsyscall_darwin_arm64.s
│ │ ├── zsyscall_dragonfly_amd64.go
│ │ ├── zsyscall_freebsd_386.go
│ │ ├── zsyscall_freebsd_amd64.go
│ │ ├── zsyscall_freebsd_arm.go
│ │ ├── zsyscall_freebsd_arm64.go
│ │ ├── zsyscall_illumos_amd64.go
│ │ ├── zsyscall_linux.go
│ │ ├── zsyscall_linux_386.go
│ │ ├── zsyscall_linux_amd64.go
│ │ ├── zsyscall_linux_arm.go
│ │ ├── zsyscall_linux_arm64.go
│ │ ├── zsyscall_linux_loong64.go
│ │ ├── zsyscall_linux_mips.go
│ │ ├── zsyscall_linux_mips64.go
│ │ ├── zsyscall_linux_mips64le.go
│ │ ├── zsyscall_linux_mipsle.go
│ │ ├── zsyscall_linux_ppc.go
│ │ ├── zsyscall_linux_ppc64.go
│ │ ├── zsyscall_linux_ppc64le.go
│ │ ├── zsyscall_linux_riscv64.go
│ │ ├── zsyscall_linux_s390x.go
│ │ ├── zsyscall_linux_sparc64.go
│ │ ├── zsyscall_netbsd_386.go
│ │ ├── zsyscall_netbsd_amd64.go
│ │ ├── zsyscall_netbsd_arm.go
│ │ ├── zsyscall_netbsd_arm64.go
│ │ ├── zsyscall_openbsd_386.go
│ │ ├── zsyscall_openbsd_amd64.go
│ │ ├── zsyscall_openbsd_arm.go
│ │ ├── zsyscall_openbsd_arm64.go
│ │ ├── zsyscall_openbsd_mips64.go
│ │ ├── zsyscall_solaris_amd64.go
│ │ ├── zsyscall_zos_s390x.go
│ │ ├── zsysctl_openbsd_386.go
│ │ ├── zsysctl_openbsd_amd64.go
│ │ ├── zsysctl_openbsd_arm.go
│ │ ├── zsysctl_openbsd_arm64.go
│ │ ├── zsysctl_openbsd_mips64.go
│ │ ├── zsysnum_darwin_amd64.go
│ │ ├── zsysnum_darwin_arm64.go
│ │ ├── zsysnum_dragonfly_amd64.go
│ │ ├── zsysnum_freebsd_386.go
│ │ ├── zsysnum_freebsd_amd64.go
│ │ ├── zsysnum_freebsd_arm.go
│ │ ├── zsysnum_freebsd_arm64.go
│ │ ├── zsysnum_linux_386.go
│ │ ├── zsysnum_linux_amd64.go
│ │ ├── zsysnum_linux_arm.go
│ │ ├── zsysnum_linux_arm64.go
│ │ ├── zsysnum_linux_loong64.go
│ │ ├── zsysnum_linux_mips.go
│ │ ├── zsysnum_linux_mips64.go
│ │ ├── zsysnum_linux_mips64le.go
│ │ ├── zsysnum_linux_mipsle.go
│ │ ├── zsysnum_linux_ppc.go
│ │ ├── zsysnum_linux_ppc64.go
│ │ ├── zsysnum_linux_ppc64le.go
│ │ ├── zsysnum_linux_riscv64.go
│ │ ├── zsysnum_linux_s390x.go
│ │ ├── zsysnum_linux_sparc64.go
│ │ ├── zsysnum_netbsd_386.go
│ │ ├── zsysnum_netbsd_amd64.go
│ │ ├── zsysnum_netbsd_arm.go
│ │ ├── zsysnum_netbsd_arm64.go
│ │ ├── zsysnum_openbsd_386.go
│ │ ├── zsysnum_openbsd_amd64.go
│ │ ├── zsysnum_openbsd_arm.go
│ │ ├── zsysnum_openbsd_arm64.go
│ │ ├── zsysnum_openbsd_mips64.go
│ │ ├── zsysnum_zos_s390x.go
│ │ ├── ztypes_aix_ppc.go
│ │ ├── ztypes_aix_ppc64.go
│ │ ├── ztypes_darwin_amd64.go
│ │ ├── ztypes_darwin_arm64.go
│ │ ├── ztypes_dragonfly_amd64.go
│ │ ├── ztypes_freebsd_386.go
│ │ ├── ztypes_freebsd_amd64.go
│ │ ├── ztypes_freebsd_arm.go
│ │ ├── ztypes_freebsd_arm64.go
│ │ ├── ztypes_illumos_amd64.go
│ │ ├── ztypes_linux.go
│ │ ├── ztypes_linux_386.go
│ │ ├── ztypes_linux_amd64.go
│ │ ├── ztypes_linux_arm.go
│ │ ├── ztypes_linux_arm64.go
│ │ ├── ztypes_linux_loong64.go
│ │ ├── ztypes_linux_mips.go
│ │ ├── ztypes_linux_mips64.go
│ │ ├── ztypes_linux_mips64le.go
│ │ ├── ztypes_linux_mipsle.go
│ │ ├── ztypes_linux_ppc.go
│ │ ├── ztypes_linux_ppc64.go
│ │ ├── ztypes_linux_ppc64le.go
│ │ ├── ztypes_linux_riscv64.go
│ │ ├── ztypes_linux_s390x.go
│ │ ├── ztypes_linux_sparc64.go
│ │ ├── ztypes_netbsd_386.go
│ │ ├── ztypes_netbsd_amd64.go
│ │ ├── ztypes_netbsd_arm.go
│ │ ├── ztypes_netbsd_arm64.go
│ │ ├── ztypes_openbsd_386.go
│ │ ├── ztypes_openbsd_amd64.go
│ │ ├── ztypes_openbsd_arm.go
│ │ ├── ztypes_openbsd_arm64.go
│ │ ├── ztypes_openbsd_mips64.go
│ │ ├── ztypes_solaris_amd64.go
│ │ └── ztypes_zos_s390x.go
│ └── windows
│ │ ├── aliases.go
│ │ ├── dll_windows.go
│ │ ├── empty.s
│ │ ├── env_windows.go
│ │ ├── eventlog.go
│ │ ├── exec_windows.go
│ │ ├── memory_windows.go
│ │ ├── mkerrors.bash
│ │ ├── mkknownfolderids.bash
│ │ ├── mksyscall.go
│ │ ├── race.go
│ │ ├── race0.go
│ │ ├── security_windows.go
│ │ ├── service.go
│ │ ├── setupapi_windows.go
│ │ ├── str.go
│ │ ├── syscall.go
│ │ ├── syscall_windows.go
│ │ ├── types_windows.go
│ │ ├── types_windows_386.go
│ │ ├── types_windows_amd64.go
│ │ ├── types_windows_arm.go
│ │ ├── types_windows_arm64.go
│ │ ├── zerrors_windows.go
│ │ ├── zknownfolderids_windows.go
│ │ └── zsyscall_windows.go
│ └── term
│ ├── AUTHORS
│ ├── CONTRIBUTING.md
│ ├── CONTRIBUTORS
│ ├── LICENSE
│ ├── PATENTS
│ ├── README.md
│ ├── codereview.cfg
│ ├── term.go
│ ├── term_plan9.go
│ ├── term_unix.go
│ ├── term_unix_bsd.go
│ ├── term_unix_other.go
│ ├── term_unsupported.go
│ ├── term_windows.go
│ └── terminal.go
└── modules.txt
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [liamg]
2 |
--------------------------------------------------------------------------------
/.github/workflows/antispam.yml:
--------------------------------------------------------------------------------
1 | name: antispam
2 |
3 | on:
4 | issues:
5 | types:
6 | - opened
7 | - edited
8 | - reopened
9 | pull_request:
10 | types:
11 | - opened
12 | - edited
13 | - reopened
14 | - synchronize
15 |
16 | permissions:
17 | pull-requests: write
18 | issues: write
19 |
20 | jobs:
21 | build:
22 | name: Antispam
23 | runs-on: ubuntu-latest
24 |
25 | steps:
26 | - uses: liamg/antispam-action@1
27 | with:
28 | token: ${{ github.token }}
29 |
--------------------------------------------------------------------------------
/.github/workflows/pr.yml:
--------------------------------------------------------------------------------
1 | on: [pull_request]
2 | name: Test
3 | jobs:
4 | test:
5 | strategy:
6 | matrix:
7 | go-version: [1.18.x]
8 | os: [ubuntu-latest]
9 | runs-on: ${{ matrix.os }}
10 | steps:
11 | - name: Install Go
12 | uses: actions/setup-go@v2
13 | with:
14 | go-version: ${{ matrix.go-version }}
15 | - name: Checkout code
16 | uses: actions/checkout@v2
17 | - name: Test
18 | run: go test ./... -race -cover
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /traitor
2 | .idea
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Liam Galvin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 |
2 |
3 | .PHONY: build
4 | build:
5 | CGO_ENABLED=0 go build ./cmd/traitor
6 |
7 | .PHONY: pack
8 | pack:
9 | go run ./cmd/pack
10 |
11 | .PHONY: install
12 | install:
13 | CGO_ENABLED=0 go install -ldflags "-X github.com/liamg/traitor/version.Version=`git describe --tags`" ./cmd/traitor
14 |
15 | .PHONY: test
16 | test:
17 | go test ./... -race -cover
18 |
--------------------------------------------------------------------------------
/cmd/traitor/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "github.com/liamg/traitor/internal/cmd"
5 | )
6 |
7 | func main() {
8 | cmd.Execute()
9 | }
10 |
--------------------------------------------------------------------------------
/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liamg/traitor/0d221ba0d0e6abf48e7ec602eac03ac45381f24e/demo.gif
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/liamg/traitor
2 |
3 | go 1.18
4 |
5 | require (
6 | github.com/creack/pty v1.1.18
7 | github.com/google/uuid v1.3.0
8 | github.com/hashicorp/go-version v1.5.0
9 | github.com/liamg/tml v0.6.0
10 | github.com/spf13/cobra v1.5.0
11 | golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
12 | golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c
13 | )
14 |
15 | require (
16 | github.com/inconshreveable/mousetrap v1.0.0 // indirect
17 | github.com/spf13/pflag v1.0.5 // indirect
18 | golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
19 | )
20 |
--------------------------------------------------------------------------------
/internal/cmd/backdoor.go:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "fmt"
5 | "os"
6 |
7 | "github.com/liamg/traitor/pkg/backdoor"
8 |
9 | "github.com/spf13/cobra"
10 | )
11 |
12 | func init() {
13 | backdoorCmd.AddCommand(backdoorInstallCmd)
14 | backdoorCmd.AddCommand(backdoorUninstallCmd)
15 | rootCmd.AddCommand(backdoorCmd)
16 | }
17 |
18 | var backdoorCmd = &cobra.Command{
19 | Use: "backdoor",
20 | Short: "Install a root shell backdoor",
21 | }
22 |
23 | var backdoorInstallCmd = &cobra.Command{
24 | Use: "install [path]",
25 | Short: "Install a root shell backdoor",
26 | Args: cobra.MaximumNArgs(1),
27 | Run: func(cmd *cobra.Command, args []string) {
28 |
29 | var path *string
30 | var err error
31 | if len(args) == 1 {
32 | path, err = backdoor.InstallToPath(args[0])
33 | } else {
34 | path, err = backdoor.Install()
35 | }
36 | if err != nil {
37 | fail("Failed to install backdoor: %s", err)
38 | }
39 |
40 | fmt.Println(*path)
41 | },
42 | }
43 |
44 | var backdoorUninstallCmd = &cobra.Command{
45 | Use: "uninstall [path]",
46 | Short: "Uninstall a root shell backdoor",
47 | Args: cobra.MaximumNArgs(1),
48 | Run: func(cmd *cobra.Command, args []string) {
49 |
50 | path, err := os.Executable()
51 | if err != nil {
52 | fail("Failed to determine executable path: %s", err)
53 | }
54 |
55 | if len(args) == 0 {
56 | info, err := os.Stat(path)
57 | if err != nil {
58 | fail("Failed to stat path: %s", err)
59 | }
60 | if info.Mode()&os.ModeSetuid == 0 {
61 | fail("Not a backdoor.")
62 | }
63 | } else {
64 | path = args[1]
65 | }
66 |
67 | if err := backdoor.Uninstall(path); err != nil {
68 | fail("Failed to remove backdoor: %s", err)
69 | }
70 |
71 | fmt.Println("Backdoor removed.")
72 | },
73 | }
74 |
--------------------------------------------------------------------------------
/internal/cmd/list.go:
--------------------------------------------------------------------------------
1 | package cmd
2 |
3 | import (
4 | "fmt"
5 | "github.com/liamg/traitor/pkg/exploits"
6 | "github.com/spf13/cobra"
7 | )
8 |
9 |
10 | func init() {
11 | rootCmd.AddCommand(listCmd)
12 | }
13 |
14 | var listCmd = &cobra.Command{
15 | Use: "list",
16 | Short: "List all available methods.",
17 | Run: func(cmd *cobra.Command, args []string) {
18 | allExploits := exploits.Get(exploits.SpeedAny)
19 | for _, exploit := range allExploits {
20 | fmt.Println(exploit.Name)
21 | }
22 | },
23 | }
24 |
--------------------------------------------------------------------------------
/internal/pipe/pipe.go:
--------------------------------------------------------------------------------
1 | package pipe
2 |
3 | import (
4 | "fmt"
5 | "io"
6 | "strings"
7 | "sync"
8 | "time"
9 | )
10 |
11 | type LockablePipe struct {
12 | input io.Reader
13 | received []byte
14 | mu sync.Mutex
15 | }
16 |
17 | func NewLockable(input io.Reader) *LockablePipe {
18 | return &LockablePipe{
19 | input: input,
20 | }
21 | }
22 |
23 | func (l *LockablePipe) Flush() []byte {
24 | l.mu.Lock()
25 | defer l.mu.Unlock()
26 | output := l.received[:]
27 | l.received = nil
28 | return output
29 | }
30 |
31 | func (l *LockablePipe) WaitForString(expected string, until time.Duration) error {
32 | buffer := make([]byte, 0xff)
33 | timer := time.NewTimer(until)
34 | errChan := make(chan error, 1)
35 | var quit bool
36 | l.mu.Lock()
37 | go func() {
38 | defer l.mu.Unlock()
39 | for {
40 | if quit {
41 | return
42 | }
43 | n, err := l.input.Read(buffer)
44 | if err != nil {
45 | errChan <- err
46 | return
47 | }
48 | if quit {
49 | return
50 | }
51 | l.received = append(l.received, buffer[:n]...)
52 | if strings.Contains(string(l.received), expected) {
53 | errChan <- nil
54 | return
55 | }
56 | }
57 | }()
58 |
59 | select {
60 | case <-timer.C:
61 | quit = true
62 | return fmt.Errorf("timed out")
63 | case err := <-errChan:
64 | return err
65 | }
66 |
67 | }
68 |
69 | func (l *LockablePipe) Read(p []byte) (n int, err error) {
70 |
71 | l.mu.Lock()
72 | defer l.mu.Unlock()
73 |
74 | if len(l.received) > 0 {
75 | // we still have some buffer to flush
76 | n = copy(p, l.received)
77 | l.received = l.received[n:]
78 | return
79 | }
80 |
81 | return l.input.Read(p)
82 | }
83 |
--------------------------------------------------------------------------------
/internal/version/version.go:
--------------------------------------------------------------------------------
1 | package version
2 |
3 | var Version string = "v0.0.0"
4 |
--------------------------------------------------------------------------------
/pkg/exploits/all.go:
--------------------------------------------------------------------------------
1 | package exploits
2 |
3 | import (
4 | "github.com/liamg/traitor/pkg/exploits/cve20213560"
5 | "github.com/liamg/traitor/pkg/exploits/cve20214034"
6 | "github.com/liamg/traitor/pkg/exploits/cve20220847"
7 | "github.com/liamg/traitor/pkg/exploits/dockersock"
8 | )
9 |
10 | func init() {
11 | register("docker:writable-socket", SpeedFast, dockersock.New())
12 | }
13 |
14 | func init() {
15 | register("polkit:CVE-2021-3560", SpeedFast, cve20213560.New())
16 | }
17 |
18 | func init() {
19 | register("polkit:CVE-2021-4034", SpeedFast, cve20214034.New())
20 | }
21 |
22 | func init() {
23 | register("kernel:CVE-2022-0847", SpeedFast, cve20220847.New())
24 | }
25 |
--------------------------------------------------------------------------------
/pkg/exploits/registration.go:
--------------------------------------------------------------------------------
1 | package exploits
2 |
3 | type Speed uint
4 |
5 | const (
6 | SpeedAny Speed = iota
7 | SpeedSlow
8 | SpeedFast
9 | )
10 |
11 | type Registration struct {
12 | Name string
13 | Vulnerability Vulnerability
14 | Speed Speed
15 | }
16 |
17 | var registeredVulnerabilities []Registration
18 |
19 | func Get(speed Speed) []Registration {
20 | var matched []Registration
21 | for _, registration := range registeredVulnerabilities {
22 | if speed == SpeedAny || registration.Speed == speed {
23 | matched = append(matched, registration)
24 | }
25 | }
26 | return matched
27 | }
28 |
29 | func register(name string, speed Speed, vulnerability Vulnerability) {
30 | registeredVulnerabilities = append(registeredVulnerabilities, Registration{
31 | Vulnerability: vulnerability,
32 | Speed: speed,
33 | Name: name,
34 | })
35 | }
36 |
--------------------------------------------------------------------------------
/pkg/exploits/types.go:
--------------------------------------------------------------------------------
1 | package exploits
2 |
3 | import (
4 | "context"
5 |
6 | "github.com/liamg/traitor/pkg/payloads"
7 |
8 | "github.com/liamg/traitor/pkg/logger"
9 |
10 | "github.com/liamg/traitor/pkg/state"
11 | )
12 |
13 | type Vulnerability interface {
14 | IsVulnerable(ctx context.Context, s *state.State, l logger.Logger) bool
15 | }
16 |
17 | type Exploit interface {
18 | Exploit(ctx context.Context, s *state.State, l logger.Logger, payload payloads.Payload) error
19 | }
20 |
21 | type ShellDropper interface {
22 | Shell(ctx context.Context, s *state.State, l logger.Logger) error
23 | }
24 |
25 | type Disclosure interface {
26 | Disclose(ctx context.Context, s *state.State, l logger.Logger) error
27 | }
28 |
--------------------------------------------------------------------------------
/pkg/logger/logger.go:
--------------------------------------------------------------------------------
1 | package logger
2 |
3 | import (
4 | "fmt"
5 |
6 | "github.com/liamg/tml"
7 | )
8 |
9 | type Logger struct {
10 | title string
11 | silenced bool
12 | }
13 |
14 | func New() Logger {
15 | return Logger{}
16 | }
17 |
18 | func (logger Logger) Silenced() Logger {
19 | logger.silenced = true
20 | return logger
21 | }
22 |
23 | func (logger Logger) WithTitle(title string) Logger {
24 | logger.title = title
25 | return logger
26 | }
27 |
28 | func (logger Logger) Printf(format string, args ...interface{}) {
29 | if logger.silenced {
30 | return
31 | }
32 | _ = tml.Printf("\r[+]")
33 | if logger.title != "" {
34 | _ = tml.Printf("[%s]", logger.title)
35 | }
36 | line := fmt.Sprintf(format, args...)
37 | _ = tml.Printf(" %s\r\n", line)
38 | }
39 |
--------------------------------------------------------------------------------
/pkg/payloads/payloads.go:
--------------------------------------------------------------------------------
1 | package payloads
2 |
3 | type Payload string
4 |
5 | var Default Payload = "/bin/sh"
6 | var Defer Payload
--------------------------------------------------------------------------------
/pkg/random/filename.go:
--------------------------------------------------------------------------------
1 | package random
2 |
3 | import (
4 | "math/rand"
5 | "time"
6 | )
7 |
8 | func init() {
9 | rand.Seed(time.Now().UnixNano())
10 | }
11 |
12 | var filenameRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_-")
13 |
14 | func Filename() string {
15 | b := make([]rune, 8+rand.Intn(8))
16 | for i := range b {
17 | b[i] = filenameRunes[rand.Intn(len(filenameRunes))]
18 | }
19 | return string(b)
20 | }
21 |
22 | var imageRunes = []rune("abcdefghijklmnopqrstuvwxyz")
23 |
24 | func Image() string {
25 | b := make([]rune, 8+rand.Intn(8))
26 | for i := range b {
27 | b[i] = imageRunes[rand.Intn(len(imageRunes))]
28 | }
29 | return string(b)
30 | }
31 |
--------------------------------------------------------------------------------
/pkg/state/distro.go:
--------------------------------------------------------------------------------
1 | package state
2 |
3 | import (
4 | "os/exec"
5 | "strings"
6 | )
7 |
8 | type DistributionID string
9 |
10 | const (
11 | UnknownLinux DistributionID = "linux" // default
12 | Ubuntu DistributionID = "ubuntu"
13 | Debian DistributionID = "debian"
14 | Arch DistributionID = "arch"
15 | RHEL DistributionID = "rhel"
16 | Fedora DistributionID = "fedora"
17 | CentOS DistributionID = "centos"
18 | Kali DistributionID = "kali"
19 | Parrot DistributionID = "parrot"
20 | Alpine DistributionID = "alpine"
21 | OpenSUSE DistributionID = "opensuse"
22 | )
23 |
24 | func (s *State) processDistro() {
25 | s.DistroID = UnknownLinux
26 | data, err := exec.Command("sh", "-c", "cat /etc/*-release").Output()
27 | if err != nil {
28 | return
29 | }
30 | for _, line := range strings.Split(string(data), "\n") {
31 | if strings.HasPrefix(line, "ID=") {
32 | s.DistroID = DistributionID(strings.TrimSpace(line[3:]))
33 | }
34 | if strings.HasPrefix(line, "VERSION=") {
35 | s.DistroVersion = strings.TrimSpace(line[8:])
36 | }
37 | }
38 | }
39 |
40 | func (s *State) IsDebianLike() bool {
41 | switch s.DistroID {
42 | case Debian, Ubuntu, Kali, Parrot:
43 | return true
44 | }
45 |
46 | return false
47 | }
48 |
--------------------------------------------------------------------------------
/pkg/state/kernel.go:
--------------------------------------------------------------------------------
1 | package state
2 |
3 | import "os"
4 |
5 | func kernelVersion() string {
6 | b, err := os.ReadFile("/proc/sys/kernel/osrelease")
7 | if err != nil {
8 | return ""
9 | }
10 | return string(b)
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/pkg/state/packages.go:
--------------------------------------------------------------------------------
1 | package state
2 |
3 | import "os/exec"
4 |
5 | func (s *State) IsPackageInstalled(name string) bool {
6 |
7 | switch s.DistroID {
8 | case Debian, Ubuntu, Kali, Parrot:
9 | return exec.Command("dpkg", "-s", name).Run() == nil
10 | case Arch:
11 | return exec.Command("pacman", "-Qi", name).Run() == nil
12 | case Fedora, RHEL, CentOS, OpenSUSE:
13 | return exec.Command("rpm", "-q", name).Run() == nil
14 | case Alpine:
15 | return exec.Command("apk", "-e", "info", name).Run() == nil
16 | default:
17 | return false
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/pkg/state/state.go:
--------------------------------------------------------------------------------
1 | package state
2 |
3 | import "os"
4 |
5 | type State struct {
6 | HasPassword bool
7 | SudoEntries Sudoers
8 | Hostname string
9 | DistroID DistributionID
10 | DistroVersion string
11 | KernelVersion string
12 | }
13 |
14 | func New() *State {
15 | return &State{}
16 | }
17 |
18 | func (s *State) Assess() {
19 |
20 | s.Hostname, _ = os.Hostname()
21 |
22 | s.processSudoers(s.Hostname)
23 |
24 | s.processDistro()
25 |
26 | s.KernelVersion = kernelVersion()
27 |
28 | // check existing backdoors
29 | // list users
30 | // list current user + groups
31 | // sudo -l
32 | // os info:
33 | // (cat /proc/version || uname -a ) 2>/dev/null
34 | // lsb_release -a 2>/dev/null
35 | // env vars
36 | // disks
37 | // printers
38 | // app armor/selinux etc.
39 | // installed packages
40 | // processes
41 | // cron
42 | // services
43 | // network
44 | }
45 |
--------------------------------------------------------------------------------
/polkit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liamg/traitor/0d221ba0d0e6abf48e7ec602eac03ac45381f24e/polkit.png
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/.gitignore:
--------------------------------------------------------------------------------
1 | [568].out
2 | _go*
3 | _test*
4 | _obj
5 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/Dockerfile.golang:
--------------------------------------------------------------------------------
1 | ARG GOVERSION=1.14
2 | FROM golang:${GOVERSION}
3 |
4 | # Set base env.
5 | ARG GOOS=linux
6 | ARG GOARCH=amd64
7 | ENV GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w'
8 |
9 | # Pre compile the stdlib for 386/arm (32bits).
10 | RUN go build -a std
11 |
12 | # Add the code to the image.
13 | WORKDIR pty
14 | ADD . .
15 |
16 | # Build the lib.
17 | RUN go build
18 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/Dockerfile.riscv:
--------------------------------------------------------------------------------
1 | # NOTE: Using 1.13 as a base to build the RISCV compiler, the resulting version is based on go1.6.
2 | FROM golang:1.13
3 |
4 | # Clone and complie a riscv compatible version of the go compiler.
5 | RUN git clone https://review.gerrithub.io/riscv/riscv-go /riscv-go
6 | # riscvdev branch HEAD as of 2019-06-29.
7 | RUN cd /riscv-go && git checkout 04885fddd096d09d4450726064d06dd107e374bf
8 | ENV PATH=/riscv-go/misc/riscv:/riscv-go/bin:$PATH
9 | RUN cd /riscv-go/src && GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash
10 | ENV GOROOT=/riscv-go
11 |
12 | # Set the base env.
13 | ENV GOOS=linux GOARCH=riscv CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w'
14 |
15 | # Pre compile the stdlib.
16 | RUN go build -a std
17 |
18 | # Add the code to the image.
19 | WORKDIR pty
20 | ADD . .
21 |
22 | # Build the lib.
23 | RUN go build
24 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Keith Rarick
2 |
3 | Permission is hereby granted, free of charge, to any person
4 | obtaining a copy of this software and associated
5 | documentation files (the "Software"), to deal in the
6 | Software without restriction, including without limitation
7 | the rights to use, copy, modify, merge, publish, distribute,
8 | sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall
13 | be included in all copies or substantial portions of the
14 | Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 | KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
20 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/asm_solaris_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | //+build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
12 | //
13 |
14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88
15 | JMP syscall·sysvicall6(SB)
16 |
17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
18 | JMP syscall·rawSysvicall6(SB)
19 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/doc.go:
--------------------------------------------------------------------------------
1 | // Package pty provides functions for working with Unix terminals.
2 | package pty
3 |
4 | import (
5 | "errors"
6 | "os"
7 | )
8 |
9 | // ErrUnsupported is returned if a function is not
10 | // available on the current platform.
11 | var ErrUnsupported = errors.New("unsupported")
12 |
13 | // Open a pty and its corresponding tty.
14 | func Open() (pty, tty *os.File, err error) {
15 | return open()
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ioctl.go:
--------------------------------------------------------------------------------
1 | //go:build !windows && !solaris && !aix
2 | // +build !windows,!solaris,!aix
3 |
4 | package pty
5 |
6 | import "syscall"
7 |
8 | const (
9 | TIOCGWINSZ = syscall.TIOCGWINSZ
10 | TIOCSWINSZ = syscall.TIOCSWINSZ
11 | )
12 |
13 | func ioctl(fd, cmd, ptr uintptr) error {
14 | _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr)
15 | if e != 0 {
16 | return e
17 | }
18 | return nil
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ioctl_bsd.go:
--------------------------------------------------------------------------------
1 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd
2 | // +build darwin dragonfly freebsd netbsd openbsd
3 |
4 | package pty
5 |
6 | // from
7 | const (
8 | _IOC_VOID uintptr = 0x20000000
9 | _IOC_OUT uintptr = 0x40000000
10 | _IOC_IN uintptr = 0x80000000
11 | _IOC_IN_OUT uintptr = _IOC_OUT | _IOC_IN
12 | _IOC_DIRMASK = _IOC_VOID | _IOC_OUT | _IOC_IN
13 |
14 | _IOC_PARAM_SHIFT = 13
15 | _IOC_PARAM_MASK = (1 << _IOC_PARAM_SHIFT) - 1
16 | )
17 |
18 | func _IOC_PARM_LEN(ioctl uintptr) uintptr {
19 | return (ioctl >> 16) & _IOC_PARAM_MASK
20 | }
21 |
22 | func _IOC(inout uintptr, group byte, ioctl_num uintptr, param_len uintptr) uintptr {
23 | return inout | (param_len&_IOC_PARAM_MASK)<<16 | uintptr(group)<<8 | ioctl_num
24 | }
25 |
26 | func _IO(group byte, ioctl_num uintptr) uintptr {
27 | return _IOC(_IOC_VOID, group, ioctl_num, 0)
28 | }
29 |
30 | func _IOR(group byte, ioctl_num uintptr, param_len uintptr) uintptr {
31 | return _IOC(_IOC_OUT, group, ioctl_num, param_len)
32 | }
33 |
34 | func _IOW(group byte, ioctl_num uintptr, param_len uintptr) uintptr {
35 | return _IOC(_IOC_IN, group, ioctl_num, param_len)
36 | }
37 |
38 | func _IOWR(group byte, ioctl_num uintptr, param_len uintptr) uintptr {
39 | return _IOC(_IOC_IN_OUT, group, ioctl_num, param_len)
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ioctl_solaris.go:
--------------------------------------------------------------------------------
1 | //go:build solaris
2 | // +build solaris
3 |
4 | package pty
5 |
6 | import (
7 | "syscall"
8 | "unsafe"
9 | )
10 |
11 | //go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
12 | //go:linkname procioctl libc_ioctl
13 | var procioctl uintptr
14 |
15 | const (
16 | // see /usr/include/sys/stropts.h
17 | I_PUSH = uintptr((int32('S')<<8 | 002))
18 | I_STR = uintptr((int32('S')<<8 | 010))
19 | I_FIND = uintptr((int32('S')<<8 | 013))
20 |
21 | // see /usr/include/sys/ptms.h
22 | ISPTM = (int32('P') << 8) | 1
23 | UNLKPT = (int32('P') << 8) | 2
24 | PTSSTTY = (int32('P') << 8) | 3
25 | ZONEPT = (int32('P') << 8) | 4
26 | OWNERPT = (int32('P') << 8) | 5
27 |
28 | // see /usr/include/sys/termios.h
29 | TIOCSWINSZ = (uint32('T') << 8) | 103
30 | TIOCGWINSZ = (uint32('T') << 8) | 104
31 | )
32 |
33 | type strioctl struct {
34 | icCmd int32
35 | icTimeout int32
36 | icLen int32
37 | icDP unsafe.Pointer
38 | }
39 |
40 | // Defined in asm_solaris_amd64.s.
41 | func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
42 |
43 | func ioctl(fd, cmd, ptr uintptr) error {
44 | if _, _, errno := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, fd, cmd, ptr, 0, 0, 0); errno != 0 {
45 | return errno
46 | }
47 | return nil
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ioctl_unsupported.go:
--------------------------------------------------------------------------------
1 | //go:build aix
2 | // +build aix
3 |
4 | package pty
5 |
6 | const (
7 | TIOCGWINSZ = 0
8 | TIOCSWINSZ = 0
9 | )
10 |
11 | func ioctl(fd, cmd, ptr uintptr) error {
12 | return ErrUnsupported
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/mktypes.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | GOOSARCH="${GOOS}_${GOARCH}"
4 | case "$GOOSARCH" in
5 | _* | *_ | _)
6 | echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2
7 | exit 1
8 | ;;
9 | esac
10 |
11 | GODEFS="go tool cgo -godefs"
12 |
13 | $GODEFS types.go |gofmt > ztypes_$GOARCH.go
14 |
15 | case $GOOS in
16 | freebsd|dragonfly|netbsd|openbsd)
17 | $GODEFS types_$GOOS.go |gofmt > ztypes_$GOOSARCH.go
18 | ;;
19 | esac
20 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/pty_darwin.go:
--------------------------------------------------------------------------------
1 | //go:build darwin
2 | // +build darwin
3 |
4 | package pty
5 |
6 | import (
7 | "errors"
8 | "os"
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | func open() (pty, tty *os.File, err error) {
14 | pFD, err := syscall.Open("/dev/ptmx", syscall.O_RDWR|syscall.O_CLOEXEC, 0)
15 | if err != nil {
16 | return nil, nil, err
17 | }
18 | p := os.NewFile(uintptr(pFD), "/dev/ptmx")
19 | // In case of error after this point, make sure we close the ptmx fd.
20 | defer func() {
21 | if err != nil {
22 | _ = p.Close() // Best effort.
23 | }
24 | }()
25 |
26 | sname, err := ptsname(p)
27 | if err != nil {
28 | return nil, nil, err
29 | }
30 |
31 | if err := grantpt(p); err != nil {
32 | return nil, nil, err
33 | }
34 |
35 | if err := unlockpt(p); err != nil {
36 | return nil, nil, err
37 | }
38 |
39 | t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0)
40 | if err != nil {
41 | return nil, nil, err
42 | }
43 | return p, t, nil
44 | }
45 |
46 | func ptsname(f *os.File) (string, error) {
47 | n := make([]byte, _IOC_PARM_LEN(syscall.TIOCPTYGNAME))
48 |
49 | err := ioctl(f.Fd(), syscall.TIOCPTYGNAME, uintptr(unsafe.Pointer(&n[0])))
50 | if err != nil {
51 | return "", err
52 | }
53 |
54 | for i, c := range n {
55 | if c == 0 {
56 | return string(n[:i]), nil
57 | }
58 | }
59 | return "", errors.New("TIOCPTYGNAME string not NUL-terminated")
60 | }
61 |
62 | func grantpt(f *os.File) error {
63 | return ioctl(f.Fd(), syscall.TIOCPTYGRANT, 0)
64 | }
65 |
66 | func unlockpt(f *os.File) error {
67 | return ioctl(f.Fd(), syscall.TIOCPTYUNLK, 0)
68 | }
69 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/pty_linux.go:
--------------------------------------------------------------------------------
1 | //go:build linux
2 | // +build linux
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | "strconv"
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | func open() (pty, tty *os.File, err error) {
14 | p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0)
15 | if err != nil {
16 | return nil, nil, err
17 | }
18 | // In case of error after this point, make sure we close the ptmx fd.
19 | defer func() {
20 | if err != nil {
21 | _ = p.Close() // Best effort.
22 | }
23 | }()
24 |
25 | sname, err := ptsname(p)
26 | if err != nil {
27 | return nil, nil, err
28 | }
29 |
30 | if err := unlockpt(p); err != nil {
31 | return nil, nil, err
32 | }
33 |
34 | t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0) //nolint:gosec // Expected Open from a variable.
35 | if err != nil {
36 | return nil, nil, err
37 | }
38 | return p, t, nil
39 | }
40 |
41 | func ptsname(f *os.File) (string, error) {
42 | var n _C_uint
43 | err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))) //nolint:gosec // Expected unsafe pointer for Syscall call.
44 | if err != nil {
45 | return "", err
46 | }
47 | return "/dev/pts/" + strconv.Itoa(int(n)), nil
48 | }
49 |
50 | func unlockpt(f *os.File) error {
51 | var u _C_int
52 | // use TIOCSPTLCK with a pointer to zero to clear the lock
53 | return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) //nolint:gosec // Expected unsafe pointer for Syscall call.
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/pty_netbsd.go:
--------------------------------------------------------------------------------
1 | //go:build netbsd
2 | // +build netbsd
3 |
4 | package pty
5 |
6 | import (
7 | "errors"
8 | "os"
9 | "syscall"
10 | "unsafe"
11 | )
12 |
13 | func open() (pty, tty *os.File, err error) {
14 | p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0)
15 | if err != nil {
16 | return nil, nil, err
17 | }
18 | // In case of error after this point, make sure we close the ptmx fd.
19 | defer func() {
20 | if err != nil {
21 | _ = p.Close() // Best effort.
22 | }
23 | }()
24 |
25 | sname, err := ptsname(p)
26 | if err != nil {
27 | return nil, nil, err
28 | }
29 |
30 | if err := grantpt(p); err != nil {
31 | return nil, nil, err
32 | }
33 |
34 | // In NetBSD unlockpt() does nothing, so it isn't called here.
35 |
36 | t, err := os.OpenFile(sname, os.O_RDWR|syscall.O_NOCTTY, 0)
37 | if err != nil {
38 | return nil, nil, err
39 | }
40 | return p, t, nil
41 | }
42 |
43 | func ptsname(f *os.File) (string, error) {
44 | /*
45 | * from ptsname(3): The ptsname() function is equivalent to:
46 | * struct ptmget pm;
47 | * ioctl(fd, TIOCPTSNAME, &pm) == -1 ? NULL : pm.sn;
48 | */
49 | var ptm ptmget
50 | if err := ioctl(f.Fd(), uintptr(ioctl_TIOCPTSNAME), uintptr(unsafe.Pointer(&ptm))); err != nil {
51 | return "", err
52 | }
53 | name := make([]byte, len(ptm.Sn))
54 | for i, c := range ptm.Sn {
55 | name[i] = byte(c)
56 | if c == 0 {
57 | return string(name[:i]), nil
58 | }
59 | }
60 | return "", errors.New("TIOCPTSNAME string not NUL-terminated")
61 | }
62 |
63 | func grantpt(f *os.File) error {
64 | /*
65 | * from grantpt(3): Calling grantpt() is equivalent to:
66 | * ioctl(fd, TIOCGRANTPT, 0);
67 | */
68 | return ioctl(f.Fd(), uintptr(ioctl_TIOCGRANTPT), 0)
69 | }
70 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/pty_openbsd.go:
--------------------------------------------------------------------------------
1 | //go:build openbsd
2 | // +build openbsd
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | "syscall"
9 | "unsafe"
10 | )
11 |
12 | func open() (pty, tty *os.File, err error) {
13 | /*
14 | * from ptm(4):
15 | * The PTMGET command allocates a free pseudo terminal, changes its
16 | * ownership to the caller, revokes the access privileges for all previous
17 | * users, opens the file descriptors for the pty and tty devices and
18 | * returns them to the caller in struct ptmget.
19 | */
20 |
21 | p, err := os.OpenFile("/dev/ptm", os.O_RDWR|syscall.O_CLOEXEC, 0)
22 | if err != nil {
23 | return nil, nil, err
24 | }
25 | defer p.Close()
26 |
27 | var ptm ptmget
28 | if err := ioctl(p.Fd(), uintptr(ioctl_PTMGET), uintptr(unsafe.Pointer(&ptm))); err != nil {
29 | return nil, nil, err
30 | }
31 |
32 | pty = os.NewFile(uintptr(ptm.Cfd), "/dev/ptm")
33 | tty = os.NewFile(uintptr(ptm.Sfd), "/dev/ptm")
34 |
35 | return pty, tty, nil
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/pty_unsupported.go:
--------------------------------------------------------------------------------
1 | //go:build !linux && !darwin && !freebsd && !dragonfly && !netbsd && !openbsd && !solaris
2 | // +build !linux,!darwin,!freebsd,!dragonfly,!netbsd,!openbsd,!solaris
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | )
9 |
10 | func open() (pty, tty *os.File, err error) {
11 | return nil, nil, ErrUnsupported
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/run.go:
--------------------------------------------------------------------------------
1 | package pty
2 |
3 | import (
4 | "os"
5 | "os/exec"
6 | "syscall"
7 | )
8 |
9 | // Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
10 | // and c.Stderr, calls c.Start, and returns the File of the tty's
11 | // corresponding pty.
12 | //
13 | // Starts the process in a new session and sets the controlling terminal.
14 | func Start(cmd *exec.Cmd) (*os.File, error) {
15 | return StartWithSize(cmd, nil)
16 | }
17 |
18 | // StartWithAttrs assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
19 | // and c.Stderr, calls c.Start, and returns the File of the tty's
20 | // corresponding pty.
21 | //
22 | // This will resize the pty to the specified size before starting the command if a size is provided.
23 | // The `attrs` parameter overrides the one set in c.SysProcAttr.
24 | //
25 | // This should generally not be needed. Used in some edge cases where it is needed to create a pty
26 | // without a controlling terminal.
27 | func StartWithAttrs(c *exec.Cmd, sz *Winsize, attrs *syscall.SysProcAttr) (*os.File, error) {
28 | pty, tty, err := Open()
29 | if err != nil {
30 | return nil, err
31 | }
32 | defer func() { _ = tty.Close() }() // Best effort.
33 |
34 | if sz != nil {
35 | if err := Setsize(pty, sz); err != nil {
36 | _ = pty.Close() // Best effort.
37 | return nil, err
38 | }
39 | }
40 | if c.Stdout == nil {
41 | c.Stdout = tty
42 | }
43 | if c.Stderr == nil {
44 | c.Stderr = tty
45 | }
46 | if c.Stdin == nil {
47 | c.Stdin = tty
48 | }
49 |
50 | c.SysProcAttr = attrs
51 |
52 | if err := c.Start(); err != nil {
53 | _ = pty.Close() // Best effort.
54 | return nil, err
55 | }
56 | return pty, err
57 | }
58 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/start.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 | // +build !windows
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | "os/exec"
9 | "syscall"
10 | )
11 |
12 | // StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
13 | // and c.Stderr, calls c.Start, and returns the File of the tty's
14 | // corresponding pty.
15 | //
16 | // This will resize the pty to the specified size before starting the command.
17 | // Starts the process in a new session and sets the controlling terminal.
18 | func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
19 | if cmd.SysProcAttr == nil {
20 | cmd.SysProcAttr = &syscall.SysProcAttr{}
21 | }
22 | cmd.SysProcAttr.Setsid = true
23 | cmd.SysProcAttr.Setctty = true
24 | return StartWithAttrs(cmd, ws, cmd.SysProcAttr)
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/start_windows.go:
--------------------------------------------------------------------------------
1 | //go:build windows
2 | // +build windows
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | "os/exec"
9 | )
10 |
11 | // StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
12 | // and c.Stderr, calls c.Start, and returns the File of the tty's
13 | // corresponding pty.
14 | //
15 | // This will resize the pty to the specified size before starting the command.
16 | // Starts the process in a new session and sets the controlling terminal.
17 | func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
18 | return nil, ErrUnsupported
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/winsize.go:
--------------------------------------------------------------------------------
1 | package pty
2 |
3 | import "os"
4 |
5 | // InheritSize applies the terminal size of pty to tty. This should be run
6 | // in a signal handler for syscall.SIGWINCH to automatically resize the tty when
7 | // the pty receives a window size change notification.
8 | func InheritSize(pty, tty *os.File) error {
9 | size, err := GetsizeFull(pty)
10 | if err != nil {
11 | return err
12 | }
13 | if err := Setsize(tty, size); err != nil {
14 | return err
15 | }
16 | return nil
17 | }
18 |
19 | // Getsize returns the number of rows (lines) and cols (positions
20 | // in each line) in terminal t.
21 | func Getsize(t *os.File) (rows, cols int, err error) {
22 | ws, err := GetsizeFull(t)
23 | if err != nil {
24 | return 0, 0, err
25 | }
26 | return int(ws.Rows), int(ws.Cols), nil
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/winsize_unix.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 | // +build !windows
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | "syscall"
9 | "unsafe"
10 | )
11 |
12 | // Winsize describes the terminal size.
13 | type Winsize struct {
14 | Rows uint16 // ws_row: Number of rows (in cells)
15 | Cols uint16 // ws_col: Number of columns (in cells)
16 | X uint16 // ws_xpixel: Width in pixels
17 | Y uint16 // ws_ypixel: Height in pixels
18 | }
19 |
20 | // Setsize resizes t to s.
21 | func Setsize(t *os.File, ws *Winsize) error {
22 | //nolint:gosec // Expected unsafe pointer for Syscall call.
23 | return ioctl(t.Fd(), syscall.TIOCSWINSZ, uintptr(unsafe.Pointer(ws)))
24 | }
25 |
26 | // GetsizeFull returns the full terminal size description.
27 | func GetsizeFull(t *os.File) (size *Winsize, err error) {
28 | var ws Winsize
29 |
30 | //nolint:gosec // Expected unsafe pointer for Syscall call.
31 | if err := ioctl(t.Fd(), syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(&ws))); err != nil {
32 | return nil, err
33 | }
34 | return &ws, nil
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/winsize_unsupported.go:
--------------------------------------------------------------------------------
1 | //go:build windows
2 | // +build windows
3 |
4 | package pty
5 |
6 | import (
7 | "os"
8 | )
9 |
10 | // Winsize is a dummy struct to enable compilation on unsupported platforms.
11 | type Winsize struct {
12 | Rows, Cols, X, Y uint16
13 | }
14 |
15 | // Setsize resizes t to s.
16 | func Setsize(*os.File, *Winsize) error {
17 | return ErrUnsupported
18 | }
19 |
20 | // GetsizeFull returns the full terminal size description.
21 | func GetsizeFull(*os.File) (*Winsize, error) {
22 | return nil, ErrUnsupported
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_386.go:
--------------------------------------------------------------------------------
1 | //go:build 386
2 | // +build 386
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_amd64.go:
--------------------------------------------------------------------------------
1 | //go:build amd64
2 | // +build amd64
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_arm.go:
--------------------------------------------------------------------------------
1 | //go:build arm
2 | // +build arm
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_arm64.go:
--------------------------------------------------------------------------------
1 | //go:build arm64
2 | // +build arm64
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go:
--------------------------------------------------------------------------------
1 | //go:build amd64 && dragonfly
2 | // +build amd64,dragonfly
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types_dragonfly.go
6 |
7 | package pty
8 |
9 | const (
10 | _C_SPECNAMELEN = 0x3f
11 | )
12 |
13 | type fiodgnameArg struct {
14 | Name *byte
15 | Len uint32
16 | Pad_cgo_0 [4]byte
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_freebsd_386.go:
--------------------------------------------------------------------------------
1 | //go:build 386 && freebsd
2 | // +build 386,freebsd
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types_freebsd.go
6 |
7 | package pty
8 |
9 | const (
10 | _C_SPECNAMELEN = 0x3f
11 | )
12 |
13 | type fiodgnameArg struct {
14 | Len int32
15 | Buf *byte
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_freebsd_amd64.go:
--------------------------------------------------------------------------------
1 | //go:build amd64 && freebsd
2 | // +build amd64,freebsd
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types_freebsd.go
6 |
7 | package pty
8 |
9 | const (
10 | _C_SPECNAMELEN = 0x3f
11 | )
12 |
13 | type fiodgnameArg struct {
14 | Len int32
15 | Pad_cgo_0 [4]byte
16 | Buf *byte
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_freebsd_arm.go:
--------------------------------------------------------------------------------
1 | //go:build arm && freebsd
2 | // +build arm,freebsd
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types_freebsd.go
6 |
7 | package pty
8 |
9 | const (
10 | _C_SPECNAMELEN = 0x3f
11 | )
12 |
13 | type fiodgnameArg struct {
14 | Len int32
15 | Buf *byte
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_freebsd_arm64.go:
--------------------------------------------------------------------------------
1 | //go:build arm64 && freebsd
2 | // +build arm64,freebsd
3 |
4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT.
5 | // cgo -godefs types_freebsd.go
6 |
7 | package pty
8 |
9 | const (
10 | _C_SPECNAMELEN = 0xff
11 | )
12 |
13 | type fiodgnameArg struct {
14 | Len int32
15 | Buf *byte
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_freebsd_ppc64.go:
--------------------------------------------------------------------------------
1 | // Created by cgo -godefs - DO NOT EDIT
2 | // cgo -godefs types_freebsd.go
3 |
4 | package pty
5 |
6 | const (
7 | _C_SPECNAMELEN = 0x3f
8 | )
9 |
10 | type fiodgnameArg struct {
11 | Len int32
12 | Pad_cgo_0 [4]byte
13 | Buf *byte
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_loong64.go:
--------------------------------------------------------------------------------
1 | //go:build loong64
2 | // +build loong64
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_mipsx.go:
--------------------------------------------------------------------------------
1 | //go:build (mips || mipsle || mips64 || mips64le) && linux
2 | // +build mips mipsle mips64 mips64le
3 | // +build linux
4 |
5 | // Created by cgo -godefs - DO NOT EDIT
6 | // cgo -godefs types.go
7 |
8 | package pty
9 |
10 | type (
11 | _C_int int32
12 | _C_uint uint32
13 | )
14 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_netbsd_32bit_int.go:
--------------------------------------------------------------------------------
1 | //go:build (386 || amd64 || arm || arm64) && netbsd
2 | // +build 386 amd64 arm arm64
3 | // +build netbsd
4 |
5 | package pty
6 |
7 | type ptmget struct {
8 | Cfd int32
9 | Sfd int32
10 | Cn [1024]int8
11 | Sn [1024]int8
12 | }
13 |
14 | var (
15 | ioctl_TIOCPTSNAME = 0x48087448
16 | ioctl_TIOCGRANTPT = 0x20007447
17 | )
18 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_openbsd_32bit_int.go:
--------------------------------------------------------------------------------
1 | //go:build (386 || amd64 || arm || arm64 || mips64) && openbsd
2 | // +build 386 amd64 arm arm64 mips64
3 | // +build openbsd
4 |
5 | package pty
6 |
7 | type ptmget struct {
8 | Cfd int32
9 | Sfd int32
10 | Cn [16]int8
11 | Sn [16]int8
12 | }
13 |
14 | var ioctl_PTMGET = 0x40287401
15 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_ppc64.go:
--------------------------------------------------------------------------------
1 | //go:build ppc64
2 | // +build ppc64
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_ppc64le.go:
--------------------------------------------------------------------------------
1 | //go:build ppc64le
2 | // +build ppc64le
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_riscvx.go:
--------------------------------------------------------------------------------
1 | //go:build riscv || riscv64
2 | // +build riscv riscv64
3 |
4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT.
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/creack/pty/ztypes_s390x.go:
--------------------------------------------------------------------------------
1 | //go:build s390x
2 | // +build s390x
3 |
4 | // Created by cgo -godefs - DO NOT EDIT
5 | // cgo -godefs types.go
6 |
7 | package pty
8 |
9 | type (
10 | _C_int int32
11 | _C_uint uint32
12 | )
13 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.4.3
5 | - 1.5.3
6 | - tip
7 |
8 | script:
9 | - go test -v ./...
10 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to contribute
2 |
3 | We definitely welcome patches and contribution to this project!
4 |
5 | ### Legal requirements
6 |
7 | In order to protect both you and ourselves, you will need to sign the
8 | [Contributor License Agreement](https://cla.developers.google.com/clas).
9 |
10 | You may have already signed it for other Google projects.
11 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | Paul Borman
2 | bmatsuo
3 | shawnps
4 | theory
5 | jboverfelt
6 | dsymonds
7 | cd1
8 | wallclockbuilder
9 | dansouza
10 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009,2014 Google Inc. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/README.md:
--------------------------------------------------------------------------------
1 | # uuid 
2 | The uuid package generates and inspects UUIDs based on
3 | [RFC 4122](http://tools.ietf.org/html/rfc4122)
4 | and DCE 1.1: Authentication and Security Services.
5 |
6 | This package is based on the github.com/pborman/uuid package (previously named
7 | code.google.com/p/go-uuid). It differs from these earlier packages in that
8 | a UUID is a 16 byte array rather than a byte slice. One loss due to this
9 | change is the ability to represent an invalid UUID (vs a NIL UUID).
10 |
11 | ###### Install
12 | `go get github.com/google/uuid`
13 |
14 | ###### Documentation
15 | [](http://godoc.org/github.com/google/uuid)
16 |
17 | Full `go doc` style documentation for the package can be viewed online without
18 | installing this package by using the GoDoc site here:
19 | http://pkg.go.dev/github.com/google/uuid
20 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/doc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Package uuid generates and inspects UUIDs.
6 | //
7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security
8 | // Services.
9 | //
10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to
11 | // maps or compared directly.
12 | package uuid
13 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/marshal.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package uuid
6 |
7 | import "fmt"
8 |
9 | // MarshalText implements encoding.TextMarshaler.
10 | func (uuid UUID) MarshalText() ([]byte, error) {
11 | var js [36]byte
12 | encodeHex(js[:], uuid)
13 | return js[:], nil
14 | }
15 |
16 | // UnmarshalText implements encoding.TextUnmarshaler.
17 | func (uuid *UUID) UnmarshalText(data []byte) error {
18 | id, err := ParseBytes(data)
19 | if err != nil {
20 | return err
21 | }
22 | *uuid = id
23 | return nil
24 | }
25 |
26 | // MarshalBinary implements encoding.BinaryMarshaler.
27 | func (uuid UUID) MarshalBinary() ([]byte, error) {
28 | return uuid[:], nil
29 | }
30 |
31 | // UnmarshalBinary implements encoding.BinaryUnmarshaler.
32 | func (uuid *UUID) UnmarshalBinary(data []byte) error {
33 | if len(data) != 16 {
34 | return fmt.Errorf("invalid UUID (got %d bytes)", len(data))
35 | }
36 | copy(uuid[:], data)
37 | return nil
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/node_js.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build js
6 |
7 | package uuid
8 |
9 | // getHardwareInterface returns nil values for the JS version of the code.
10 | // This remvoves the "net" dependency, because it is not used in the browser.
11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes.
12 | func getHardwareInterface(name string) (string, []byte) { return "", nil }
13 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/node_net.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 Google Inc. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build !js
6 |
7 | package uuid
8 |
9 | import "net"
10 |
11 | var interfaces []net.Interface // cached list of interfaces
12 |
13 | // getHardwareInterface returns the name and hardware address of interface name.
14 | // If name is "" then the name and hardware address of one of the system's
15 | // interfaces is returned. If no interfaces are found (name does not exist or
16 | // there are no interfaces) then "", nil is returned.
17 | //
18 | // Only addresses of at least 6 bytes are returned.
19 | func getHardwareInterface(name string) (string, []byte) {
20 | if interfaces == nil {
21 | var err error
22 | interfaces, err = net.Interfaces()
23 | if err != nil {
24 | return "", nil
25 | }
26 | }
27 | for _, ifs := range interfaces {
28 | if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) {
29 | return ifs.Name, ifs.HardwareAddr
30 | }
31 | }
32 | return "", nil
33 | }
34 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/sql.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package uuid
6 |
7 | import (
8 | "database/sql/driver"
9 | "fmt"
10 | )
11 |
12 | // Scan implements sql.Scanner so UUIDs can be read from databases transparently.
13 | // Currently, database types that map to string and []byte are supported. Please
14 | // consult database-specific driver documentation for matching types.
15 | func (uuid *UUID) Scan(src interface{}) error {
16 | switch src := src.(type) {
17 | case nil:
18 | return nil
19 |
20 | case string:
21 | // if an empty UUID comes from a table, we return a null UUID
22 | if src == "" {
23 | return nil
24 | }
25 |
26 | // see Parse for required string format
27 | u, err := Parse(src)
28 | if err != nil {
29 | return fmt.Errorf("Scan: %v", err)
30 | }
31 |
32 | *uuid = u
33 |
34 | case []byte:
35 | // if an empty UUID comes from a table, we return a null UUID
36 | if len(src) == 0 {
37 | return nil
38 | }
39 |
40 | // assumes a simple slice of bytes if 16 bytes
41 | // otherwise attempts to parse
42 | if len(src) != 16 {
43 | return uuid.Scan(string(src))
44 | }
45 | copy((*uuid)[:], src)
46 |
47 | default:
48 | return fmt.Errorf("Scan: unable to scan type %T into UUID", src)
49 | }
50 |
51 | return nil
52 | }
53 |
54 | // Value implements sql.Valuer so that UUIDs can be written to databases
55 | // transparently. Currently, UUIDs map to strings. Please consult
56 | // database-specific driver documentation for matching types.
57 | func (uuid UUID) Value() (driver.Value, error) {
58 | return uuid.String(), nil
59 | }
60 |
--------------------------------------------------------------------------------
/vendor/github.com/google/uuid/version1.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 Google Inc. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package uuid
6 |
7 | import (
8 | "encoding/binary"
9 | )
10 |
11 | // NewUUID returns a Version 1 UUID based on the current NodeID and clock
12 | // sequence, and the current time. If the NodeID has not been set by SetNodeID
13 | // or SetNodeInterface then it will be set automatically. If the NodeID cannot
14 | // be set NewUUID returns nil. If clock sequence has not been set by
15 | // SetClockSequence then it will be set automatically. If GetTime fails to
16 | // return the current NewUUID returns nil and an error.
17 | //
18 | // In most cases, New should be used.
19 | func NewUUID() (UUID, error) {
20 | var uuid UUID
21 | now, seq, err := GetTime()
22 | if err != nil {
23 | return uuid, err
24 | }
25 |
26 | timeLow := uint32(now & 0xffffffff)
27 | timeMid := uint16((now >> 32) & 0xffff)
28 | timeHi := uint16((now >> 48) & 0x0fff)
29 | timeHi |= 0x1000 // Version 1
30 |
31 | binary.BigEndian.PutUint32(uuid[0:], timeLow)
32 | binary.BigEndian.PutUint16(uuid[4:], timeMid)
33 | binary.BigEndian.PutUint16(uuid[6:], timeHi)
34 | binary.BigEndian.PutUint16(uuid[8:], seq)
35 |
36 | nodeMu.Lock()
37 | if nodeID == zeroID {
38 | setNodeInterface("")
39 | }
40 | copy(uuid[10:], nodeID[:])
41 | nodeMu.Unlock()
42 |
43 | return uuid, nil
44 | }
45 |
--------------------------------------------------------------------------------
/vendor/github.com/hashicorp/go-version/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 1.4.0 (January 5, 2022)
2 |
3 | FEATURES:
4 |
5 | - Introduce `MustConstraints()` ([#87](https://github.com/hashicorp/go-version/pull/87))
6 | - `Constraints`: Introduce `Equals()` and `sort.Interface` methods ([#88](https://github.com/hashicorp/go-version/pull/88))
7 |
8 | # 1.3.0 (March 31, 2021)
9 |
10 | Please note that CHANGELOG.md does not exist in the source code prior to this release.
11 |
12 | FEATURES:
13 | - Add `Core` function to return a version without prerelease or metadata ([#85](https://github.com/hashicorp/go-version/pull/85))
14 |
15 | # 1.2.1 (June 17, 2020)
16 |
17 | BUG FIXES:
18 | - Prevent `Version.Equal` method from panicking on `nil` encounter ([#73](https://github.com/hashicorp/go-version/pull/73))
19 |
20 | # 1.2.0 (April 23, 2019)
21 |
22 | FEATURES:
23 | - Add `GreaterThanOrEqual` and `LessThanOrEqual` helper methods ([#53](https://github.com/hashicorp/go-version/pull/53))
24 |
25 | # 1.1.0 (Jan 07, 2019)
26 |
27 | FEATURES:
28 | - Add `NewSemver` constructor ([#45](https://github.com/hashicorp/go-version/pull/45))
29 |
30 | # 1.0.0 (August 24, 2018)
31 |
32 | Initial release.
33 |
--------------------------------------------------------------------------------
/vendor/github.com/hashicorp/go-version/version_collection.go:
--------------------------------------------------------------------------------
1 | package version
2 |
3 | // Collection is a type that implements the sort.Interface interface
4 | // so that versions can be sorted.
5 | type Collection []*Version
6 |
7 | func (v Collection) Len() int {
8 | return len(v)
9 | }
10 |
11 | func (v Collection) Less(i, j int) bool {
12 | return v[i].LessThan(v[j])
13 | }
14 |
15 | func (v Collection) Swap(i, j int) {
16 | v[i], v[j] = v[j], v[i]
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/inconshreveable/mousetrap/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2014 Alan Shreve
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/vendor/github.com/inconshreveable/mousetrap/README.md:
--------------------------------------------------------------------------------
1 | # mousetrap
2 |
3 | mousetrap is a tiny library that answers a single question.
4 |
5 | On a Windows machine, was the process invoked by someone double clicking on
6 | the executable file while browsing in explorer?
7 |
8 | ### Motivation
9 |
10 | Windows developers unfamiliar with command line tools will often "double-click"
11 | the executable for a tool. Because most CLI tools print the help and then exit
12 | when invoked without arguments, this is often very frustrating for those users.
13 |
14 | mousetrap provides a way to detect these invocations so that you can provide
15 | more helpful behavior and instructions on how to run the CLI tool. To see what
16 | this looks like, both from an organizational and a technical perspective, see
17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/
18 |
19 | ### The interface
20 |
21 | The library exposes a single interface:
22 |
23 | func StartedByExplorer() (bool)
24 |
--------------------------------------------------------------------------------
/vendor/github.com/inconshreveable/mousetrap/trap_others.go:
--------------------------------------------------------------------------------
1 | // +build !windows
2 |
3 | package mousetrap
4 |
5 | // StartedByExplorer returns true if the program was invoked by the user
6 | // double-clicking on the executable from explorer.exe
7 | //
8 | // It is conservative and returns false if any of the internal calls fail.
9 | // It does not guarantee that the program was run from a terminal. It only can tell you
10 | // whether it was launched from explorer.exe
11 | //
12 | // On non-Windows platforms, it always returns false.
13 | func StartedByExplorer() bool {
14 | return false
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go:
--------------------------------------------------------------------------------
1 | // +build windows
2 | // +build go1.4
3 |
4 | package mousetrap
5 |
6 | import (
7 | "os"
8 | "syscall"
9 | "unsafe"
10 | )
11 |
12 | func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
13 | snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
14 | if err != nil {
15 | return nil, err
16 | }
17 | defer syscall.CloseHandle(snapshot)
18 | var procEntry syscall.ProcessEntry32
19 | procEntry.Size = uint32(unsafe.Sizeof(procEntry))
20 | if err = syscall.Process32First(snapshot, &procEntry); err != nil {
21 | return nil, err
22 | }
23 | for {
24 | if procEntry.ProcessID == uint32(pid) {
25 | return &procEntry, nil
26 | }
27 | err = syscall.Process32Next(snapshot, &procEntry)
28 | if err != nil {
29 | return nil, err
30 | }
31 | }
32 | }
33 |
34 | // StartedByExplorer returns true if the program was invoked by the user double-clicking
35 | // on the executable from explorer.exe
36 | //
37 | // It is conservative and returns false if any of the internal calls fail.
38 | // It does not guarantee that the program was run from a terminal. It only can tell you
39 | // whether it was launched from explorer.exe
40 | func StartedByExplorer() bool {
41 | pe, err := getProcessEntry(os.Getppid())
42 | if err != nil {
43 | return false
44 | }
45 | return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | .vscode
3 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - master
4 | env:
5 | - GO111MODULE=on
6 | script:
7 | - make build-travis
8 | deploy:
9 | - provider: releases
10 | skip_cleanup: true
11 | api_key:
12 | secure: "T/uvbRV2dguNO8pEq8xINN1U1GUOkoXVf6Yc7gN0DH7OiNfraj88V5jH5M/tIE/WpFw0zNQXA5oF0V1czs7YG5TytG3/ioUdEyWqcpkeMcFJmhk/MAmSIwbfA0jP5EKuQ7fvaRRRclcLD3rHrxYKnDrKUedaQXraz31pJTydK5IaC8vPVfYAZ4NBGenlxVLXAXZM5uwpdqxLV25BAxdlEQkn5AEeGbii59QNblF5xaoYhQ7i5NL7nn4kKYqWwEJ0+osZ0dIEHVCNaF6hmiTsv7Wv+Yt0cT9FVwsbnV/wsd4XLszbIXXCXwe/cwrs/hxSkPN1FA9Tom9Qho5DPlI4+qf9qvLI+iUZ2XgqLdAvB1zEx0Sv/VdOPHCJuejvdxLCJfHAkjBWkz6U7F1llREtQS0L9tURBbt48LrrAgMKyNoXjknIk3LRQ0Sdd2ncMZ4OMK1OjcLOlfaJnhVsXYhkIVF4n/pS0WC5qn8JqSlxUxgopH13+cELY56d0sOhbIHVSmpZml7NOfgF4K2sLqkT+2uQjWwWBic0kuQ3h5pzcJAZvjUSN6+phxUg3i/EOWeeiiYUv3LS1hX5ZEZ+4ORM++1J3lk/Btk7iH1mYJVJoSg0rWojL3nGGDMrqb+AsdkXOo5LdtjMVzkUWqfvvdzAGoITcc4+FQZ+nt9uPWrUEbA="
13 | name: "tml $TRAVIS_TAG"
14 | file:
15 | - bin/darwin-amd64/tml
16 | - bin/linux-amd64/tml
17 | on:
18 | repo: liamg/tml
19 | tags: true
20 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | This is free and unencumbered software released into the public domain.
3 |
4 | Anyone is free to copy, modify, publish, use, compile, sell, or
5 | distribute this software, either in source code form or as a compiled
6 | binary, for any purpose, commercial or non-commercial, and by any
7 | means.
8 |
9 | In jurisdictions that recognize copyright laws, the author or authors
10 | of this software dedicate any and all copyright interest in the
11 | software to the public domain. We make this dedication for the benefit
12 | of the public at large and to the detriment of our heirs and
13 | successors. We intend this dedication to be an overt act of
14 | relinquishment in perpetuity of all present and future rights to this
15 | software under copyright law.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 | OTHER DEALINGS IN THE SOFTWARE.
24 |
25 | For more information, please refer to
26 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/Makefile:
--------------------------------------------------------------------------------
1 |
2 | default: build
3 |
4 | build: test
5 | mkdir -p bin
6 | go build ./tml/ -o bin/tml
7 |
8 | build-travis: test
9 | mkdir -p bin/linux-amd64/tml
10 | mkdir -p bin/darwin-amd64/tml
11 | GOOS=linux GOARCH=amd64 go build -o bin/linux-amd64/tml -ldflags "-X github.com/liamg/tml/version.Version=${TRAVIS_TAG}" ./tml
12 | GOOS=darwin GOARCH=amd64 go build -o bin/darwin-amd64/tml -ldflags "-X github.com/liamg/tml/version.Version=${TRAVIS_TAG}" ./tml
13 |
14 | test:
15 | go vet ./...
16 | go test -v ./...
17 |
18 | .PHONY: build test
19 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/disable.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | import "sync"
4 |
5 | var disableFormatting bool
6 | var formattingLock sync.RWMutex
7 |
8 | func DisableFormatting() {
9 | formattingLock.Lock()
10 | defer formattingLock.Unlock()
11 | disableFormatting = true
12 | }
13 |
14 | func EnableFormatting() {
15 | formattingLock.Lock()
16 | defer formattingLock.Unlock()
17 | disableFormatting = false
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liamg/traitor/0d221ba0d0e6abf48e7ec602eac03ac45381f24e/vendor/github.com/liamg/tml/example.png
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/new_line.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | // NewLine prints a new line to the terminal with no content
4 | func NewLine() {
5 | Println("")
6 | }
7 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/parse.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | import (
4 | "strings"
5 | "bytes"
6 | )
7 |
8 | // Parse converts the input string (containing TML tags) into a string containing ANSI escape code sequences for output to the terminal.
9 | func Parse(input string) (string, error) {
10 | output := bytes.NewBufferString("")
11 | if err := NewParser(output).Parse(strings.NewReader(input)); err != nil {
12 | return "", err
13 | }
14 | return output.String(), nil
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/printf.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | import (
4 | "fmt"
5 | "io"
6 | "os"
7 | )
8 |
9 | // Printf works like fmt.Printf, but adds the option of using tags to apply colour or text formatting to the written text. For example "some red text".
10 | // A full list of tags is available here: https://github.com/liamg/tml
11 | func Printf(input string, a ...interface{}) error {
12 | return Fprintf(os.Stdout, input, a...)
13 | }
14 |
15 | func Fprintf(w io.Writer, input string, a ...interface{}) error {
16 | format, err := Parse(input)
17 | if err != nil {
18 | return err
19 | }
20 | _, err = fmt.Fprintf(w, format, a...)
21 | return err
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/println.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | import (
4 | "io"
5 | "os"
6 | )
7 |
8 | // Println works like fmt.Println, but adds the option of using tags to apply colour or text formatting to the written text. For example "some red text".
9 | // A full list of tags is available here: https://github.com/liamg/tml
10 | func Println(input string) {
11 | Fprintln(os.Stdout, input)
12 | }
13 |
14 | func Fprintln(w io.Writer, input string) {
15 | Fprintf(w, "%s\n", input)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/sprintf.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | import "fmt"
4 |
5 | // Sprintf works like fmt.Sprintf, but adds the option of using tags to apply colour or text formatting to the written text. For example "some red text".
6 | // A full list of tags is available here: https://github.com/liamg/tml
7 | func Sprintf(input string, a ...interface{}) string {
8 | // parsing cannot fail as the reader/writer are simply for local strings
9 | format, _ := Parse(input)
10 | return fmt.Sprintf(format, a...)
11 | }
12 |
--------------------------------------------------------------------------------
/vendor/github.com/liamg/tml/tags.go:
--------------------------------------------------------------------------------
1 | package tml
2 |
3 | var fgTags = map[string]string{
4 | "red": "\x1b[31m",
5 | "green": "\x1b[32m",
6 | "yellow": "\x1b[33m",
7 | "blue": "\x1b[34m",
8 | "magenta": "\x1b[35m",
9 | "cyan": "\x1b[36m",
10 | "lightgrey": "\x1b[37m",
11 | "darkgrey": "\x1b[90m",
12 | "black": "\x1b[30m",
13 | "lightred": "\x1b[91m",
14 | "lightgreen": "\x1b[92m",
15 | "lightyellow": "\x1b[93m",
16 | "lightblue": "\x1b[94m",
17 | "lightmagenta": "\x1b[95m",
18 | "lightcyan": "\x1b[96m",
19 | "white": "\x1b[97m",
20 | }
21 |
22 | var bgTags = map[string]string{
23 | "bg-red": "\x1b[41m",
24 | "bg-green": "\x1b[42m",
25 | "bg-yellow": "\x1b[43m",
26 | "bg-blue": "\x1b[44m",
27 | "bg-magenta": "\x1b[45m",
28 | "bg-cyan": "\x1b[46m",
29 | "bg-lightgrey": "\x1b[47m",
30 | "bg-darkgrey": "\x1b[40m",
31 | "bg-black": "\x1b[40m",
32 | "bg-lightred": "\x1b[101m",
33 | "bg-lightgreen": "\x1b[102m",
34 | "bg-lightyellow": "\x1b[103m",
35 | "bg-lightblue": "\x1b[104m",
36 | "bg-lightmagenta": "\x1b[105m",
37 | "bg-lightcyan": "\x1b[106m",
38 | "bg-white": "\x1b[107m",
39 | }
40 |
41 | var attrTags = map[string]uint8{
42 | "bold": bold,
43 | "dim": dim,
44 | "italic": italic,
45 | "underline": underline,
46 | "blink": blink,
47 | "reverse": reverse,
48 | "hidden": hidden,
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore
23 | # swap
24 | [._]*.s[a-w][a-z]
25 | [._]s[a-w][a-z]
26 | # session
27 | Session.vim
28 | # temporary
29 | .netrwhist
30 | *~
31 | # auto-generated tag files
32 | tags
33 |
34 | *.exe
35 | cobra.test
36 | bin
37 |
38 | .idea/
39 | *.iml
40 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/.golangci.yml:
--------------------------------------------------------------------------------
1 | run:
2 | deadline: 5m
3 |
4 | linters:
5 | disable-all: true
6 | enable:
7 | #- bodyclose
8 | - deadcode
9 | #- depguard
10 | #- dogsled
11 | #- dupl
12 | - errcheck
13 | #- exhaustive
14 | #- funlen
15 | - gas
16 | #- gochecknoinits
17 | - goconst
18 | #- gocritic
19 | #- gocyclo
20 | #- gofmt
21 | - goimports
22 | - golint
23 | #- gomnd
24 | #- goprintffuncname
25 | #- gosec
26 | #- gosimple
27 | - govet
28 | - ineffassign
29 | - interfacer
30 | #- lll
31 | - maligned
32 | - megacheck
33 | #- misspell
34 | #- nakedret
35 | #- noctx
36 | #- nolintlint
37 | #- rowserrcheck
38 | #- scopelint
39 | #- staticcheck
40 | - structcheck
41 | #- stylecheck
42 | #- typecheck
43 | - unconvert
44 | #- unparam
45 | #- unused
46 | - varcheck
47 | #- whitespace
48 | fast: false
49 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/.mailmap:
--------------------------------------------------------------------------------
1 | Steve Francia
2 | Bjørn Erik Pedersen
3 | Fabiano Franz
4 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/MAINTAINERS:
--------------------------------------------------------------------------------
1 | maintainers:
2 | - spf13
3 | - johnSchnake
4 | - jpmcb
5 | - marckhouzam
6 | inactive:
7 | - anthonyfok
8 | - bep
9 | - bogem
10 | - broady
11 | - eparis
12 | - jharshman
13 | - wfernandes
14 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/Makefile:
--------------------------------------------------------------------------------
1 | BIN="./bin"
2 | SRC=$(shell find . -name "*.go")
3 |
4 | ifeq (, $(shell which golangci-lint))
5 | $(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh")
6 | endif
7 |
8 | ifeq (, $(shell which richgo))
9 | $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo")
10 | endif
11 |
12 | .PHONY: fmt lint test install_deps clean
13 |
14 | default: all
15 |
16 | all: fmt test
17 |
18 | fmt:
19 | $(info ******************** checking formatting ********************)
20 | @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1)
21 |
22 | lint:
23 | $(info ******************** running lint tools ********************)
24 | golangci-lint run -v
25 |
26 | test: install_deps
27 | $(info ******************** running tests ********************)
28 | richgo test -v ./...
29 |
30 | install_deps:
31 | $(info ******************** downloading dependencies ********************)
32 | go get -v ./...
33 |
34 | clean:
35 | rm -rf $(BIN)
36 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/command_notwin.go:
--------------------------------------------------------------------------------
1 | //go:build !windows
2 | // +build !windows
3 |
4 | package cobra
5 |
6 | var preExecHookFn func(*Command)
7 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/command_win.go:
--------------------------------------------------------------------------------
1 | //go:build windows
2 | // +build windows
3 |
4 | package cobra
5 |
6 | import (
7 | "fmt"
8 | "os"
9 | "time"
10 |
11 | "github.com/inconshreveable/mousetrap"
12 | )
13 |
14 | var preExecHookFn = preExecHook
15 |
16 | func preExecHook(c *Command) {
17 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
18 | c.Print(MousetrapHelpText)
19 | if MousetrapDisplayDuration > 0 {
20 | time.Sleep(MousetrapDisplayDuration)
21 | } else {
22 | c.Println("Press return to continue...")
23 | fmt.Scanln()
24 | }
25 | os.Exit(1)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/fish_completions.md:
--------------------------------------------------------------------------------
1 | ## Generating Fish Completions For Your cobra.Command
2 |
3 | Please refer to [Shell Completions](shell_completions.md) for details.
4 |
5 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/cobra/powershell_completions.md:
--------------------------------------------------------------------------------
1 | # Generating PowerShell Completions For Your Own cobra.Command
2 |
3 | Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details.
4 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/pflag/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/*
2 |
3 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/pflag/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 |
3 | language: go
4 |
5 | go:
6 | - 1.9.x
7 | - 1.10.x
8 | - 1.11.x
9 | - tip
10 |
11 | matrix:
12 | allow_failures:
13 | - go: tip
14 |
15 | install:
16 | - go get golang.org/x/lint/golint
17 | - export PATH=$GOPATH/bin:$PATH
18 | - go install ./...
19 |
20 | script:
21 | - verify/all.sh -v
22 | - go test ./...
23 |
--------------------------------------------------------------------------------
/vendor/github.com/spf13/pflag/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012 Alex Ogier. All rights reserved.
2 | Copyright (c) 2012 The Go Authors. All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are
6 | met:
7 |
8 | * Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above
11 | copyright notice, this list of conditions and the following disclaimer
12 | in the documentation and/or other materials provided with the
13 | distribution.
14 | * Neither the name of Google Inc. nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at https://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at https://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/crypto/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Package unsafeheader contains header declarations for the Go runtime's
6 | // slice and string implementations.
7 | //
8 | // This package allows x/sys to use types equivalent to
9 | // reflect.SliceHeader and reflect.StringHeader without introducing
10 | // a dependency on the (relatively heavy) "reflect" package.
11 | package unsafeheader
12 |
13 | import (
14 | "unsafe"
15 | )
16 |
17 | // Slice is the runtime representation of a slice.
18 | // It cannot be used safely or portably and its representation may change in a later release.
19 | type Slice struct {
20 | Data unsafe.Pointer
21 | Len int
22 | Cap int
23 | }
24 |
25 | // String is the runtime representation of a string.
26 | // It cannot be used safely or portably and its representation may change in a later release.
27 | type String struct {
28 | Data unsafe.Pointer
29 | Len int
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/asm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | #include "textflag.h"
6 |
7 | TEXT ·use(SB),NOSPLIT,$0
8 | RET
9 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/asm_plan9_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | #include "textflag.h"
6 |
7 | //
8 | // System call support for 386, Plan 9
9 | //
10 |
11 | // Just jump to package syscall's implementation for all these functions.
12 | // The runtime may know about them.
13 |
14 | TEXT ·Syscall(SB),NOSPLIT,$0-32
15 | JMP syscall·Syscall(SB)
16 |
17 | TEXT ·Syscall6(SB),NOSPLIT,$0-44
18 | JMP syscall·Syscall6(SB)
19 |
20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
21 | JMP syscall·RawSyscall(SB)
22 |
23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
24 | JMP syscall·RawSyscall6(SB)
25 |
26 | TEXT ·seek(SB),NOSPLIT,$0-36
27 | JMP syscall·seek(SB)
28 |
29 | TEXT ·exit(SB),NOSPLIT,$4-4
30 | JMP syscall·exit(SB)
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | #include "textflag.h"
6 |
7 | //
8 | // System call support for amd64, Plan 9
9 | //
10 |
11 | // Just jump to package syscall's implementation for all these functions.
12 | // The runtime may know about them.
13 |
14 | TEXT ·Syscall(SB),NOSPLIT,$0-64
15 | JMP syscall·Syscall(SB)
16 |
17 | TEXT ·Syscall6(SB),NOSPLIT,$0-88
18 | JMP syscall·Syscall6(SB)
19 |
20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
21 | JMP syscall·RawSyscall(SB)
22 |
23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
24 | JMP syscall·RawSyscall6(SB)
25 |
26 | TEXT ·seek(SB),NOSPLIT,$0-56
27 | JMP syscall·seek(SB)
28 |
29 | TEXT ·exit(SB),NOSPLIT,$8-8
30 | JMP syscall·exit(SB)
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/asm_plan9_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | #include "textflag.h"
6 |
7 | // System call support for plan9 on arm
8 |
9 | // Just jump to package syscall's implementation for all these functions.
10 | // The runtime may know about them.
11 |
12 | TEXT ·Syscall(SB),NOSPLIT,$0-32
13 | JMP syscall·Syscall(SB)
14 |
15 | TEXT ·Syscall6(SB),NOSPLIT,$0-44
16 | JMP syscall·Syscall6(SB)
17 |
18 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
19 | JMP syscall·RawSyscall(SB)
20 |
21 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
22 | JMP syscall·RawSyscall6(SB)
23 |
24 | TEXT ·seek(SB),NOSPLIT,$0-36
25 | JMP syscall·exit(SB)
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/const_plan9.go:
--------------------------------------------------------------------------------
1 | package plan9
2 |
3 | // Plan 9 Constants
4 |
5 | // Open modes
6 | const (
7 | O_RDONLY = 0
8 | O_WRONLY = 1
9 | O_RDWR = 2
10 | O_TRUNC = 16
11 | O_CLOEXEC = 32
12 | O_EXCL = 0x1000
13 | )
14 |
15 | // Rfork flags
16 | const (
17 | RFNAMEG = 1 << 0
18 | RFENVG = 1 << 1
19 | RFFDG = 1 << 2
20 | RFNOTEG = 1 << 3
21 | RFPROC = 1 << 4
22 | RFMEM = 1 << 5
23 | RFNOWAIT = 1 << 6
24 | RFCNAMEG = 1 << 10
25 | RFCENVG = 1 << 11
26 | RFCFDG = 1 << 12
27 | RFREND = 1 << 13
28 | RFNOMNT = 1 << 14
29 | )
30 |
31 | // Qid.Type bits
32 | const (
33 | QTDIR = 0x80
34 | QTAPPEND = 0x40
35 | QTEXCL = 0x20
36 | QTMOUNT = 0x10
37 | QTAUTH = 0x08
38 | QTTMP = 0x04
39 | QTFILE = 0x00
40 | )
41 |
42 | // Dir.Mode bits
43 | const (
44 | DMDIR = 0x80000000
45 | DMAPPEND = 0x40000000
46 | DMEXCL = 0x20000000
47 | DMMOUNT = 0x10000000
48 | DMAUTH = 0x08000000
49 | DMTMP = 0x04000000
50 | DMREAD = 0x4
51 | DMWRITE = 0x2
52 | DMEXEC = 0x1
53 | )
54 |
55 | const (
56 | STATMAX = 65535
57 | ERRMAX = 128
58 | STATFIXLEN = 49
59 | )
60 |
61 | // Mount and bind flags
62 | const (
63 | MREPL = 0x0000
64 | MBEFORE = 0x0001
65 | MAFTER = 0x0002
66 | MORDER = 0x0003
67 | MCREATE = 0x0004
68 | MCACHE = 0x0010
69 | MMASK = 0x0017
70 | )
71 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/env_plan9.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Plan 9 environment variables.
6 |
7 | package plan9
8 |
9 | import (
10 | "syscall"
11 | )
12 |
13 | func Getenv(key string) (value string, found bool) {
14 | return syscall.Getenv(key)
15 | }
16 |
17 | func Setenv(key, value string) error {
18 | return syscall.Setenv(key, value)
19 | }
20 |
21 | func Clearenv() {
22 | syscall.Clearenv()
23 | }
24 |
25 | func Environ() []string {
26 | return syscall.Environ()
27 | }
28 |
29 | func Unsetenv(key string) error {
30 | return syscall.Unsetenv(key)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/errors_plan9.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package plan9
6 |
7 | import "syscall"
8 |
9 | // Constants
10 | const (
11 | // Invented values to support what package os expects.
12 | O_CREAT = 0x02000
13 | O_APPEND = 0x00400
14 | O_NOCTTY = 0x00000
15 | O_NONBLOCK = 0x00000
16 | O_SYNC = 0x00000
17 | O_ASYNC = 0x00000
18 |
19 | S_IFMT = 0x1f000
20 | S_IFIFO = 0x1000
21 | S_IFCHR = 0x2000
22 | S_IFDIR = 0x4000
23 | S_IFBLK = 0x6000
24 | S_IFREG = 0x8000
25 | S_IFLNK = 0xa000
26 | S_IFSOCK = 0xc000
27 | )
28 |
29 | // Errors
30 | var (
31 | EINVAL = syscall.NewError("bad arg in system call")
32 | ENOTDIR = syscall.NewError("not a directory")
33 | EISDIR = syscall.NewError("file is a directory")
34 | ENOENT = syscall.NewError("file does not exist")
35 | EEXIST = syscall.NewError("file already exists")
36 | EMFILE = syscall.NewError("no free file descriptors")
37 | EIO = syscall.NewError("i/o error")
38 | ENAMETOOLONG = syscall.NewError("file name too long")
39 | EINTR = syscall.NewError("interrupted")
40 | EPERM = syscall.NewError("permission denied")
41 | EBUSY = syscall.NewError("no free devices")
42 | ETIMEDOUT = syscall.NewError("connection timed out")
43 | EPLAN9 = syscall.NewError("not supported by plan 9")
44 |
45 | // The following errors do not correspond to any
46 | // Plan 9 system messages. Invented to support
47 | // what package os and others expect.
48 | EACCES = syscall.NewError("access permission denied")
49 | EAFNOSUPPORT = syscall.NewError("address family not supported by protocol")
50 | )
51 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Copyright 2009 The Go Authors. All rights reserved.
3 | # Use of this source code is governed by a BSD-style
4 | # license that can be found in the LICENSE file.
5 |
6 | COMMAND="mksysnum_plan9.sh $@"
7 |
8 | cat <= 10 {
17 | buf[i] = byte(val%10 + '0')
18 | i--
19 | val /= 10
20 | }
21 | buf[i] = byte(val + '0')
22 | return string(buf[i:])
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go:
--------------------------------------------------------------------------------
1 | // mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h
2 | // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
3 |
4 | package plan9
5 |
6 | const (
7 | SYS_SYSR1 = 0
8 | SYS_BIND = 2
9 | SYS_CHDIR = 3
10 | SYS_CLOSE = 4
11 | SYS_DUP = 5
12 | SYS_ALARM = 6
13 | SYS_EXEC = 7
14 | SYS_EXITS = 8
15 | SYS_FAUTH = 10
16 | SYS_SEGBRK = 12
17 | SYS_OPEN = 14
18 | SYS_OSEEK = 16
19 | SYS_SLEEP = 17
20 | SYS_RFORK = 19
21 | SYS_PIPE = 21
22 | SYS_CREATE = 22
23 | SYS_FD2PATH = 23
24 | SYS_BRK_ = 24
25 | SYS_REMOVE = 25
26 | SYS_NOTIFY = 28
27 | SYS_NOTED = 29
28 | SYS_SEGATTACH = 30
29 | SYS_SEGDETACH = 31
30 | SYS_SEGFREE = 32
31 | SYS_SEGFLUSH = 33
32 | SYS_RENDEZVOUS = 34
33 | SYS_UNMOUNT = 35
34 | SYS_SEMACQUIRE = 37
35 | SYS_SEMRELEASE = 38
36 | SYS_SEEK = 39
37 | SYS_FVERSION = 40
38 | SYS_ERRSTR = 41
39 | SYS_STAT = 42
40 | SYS_FSTAT = 43
41 | SYS_WSTAT = 44
42 | SYS_FWSTAT = 45
43 | SYS_MOUNT = 46
44 | SYS_AWAIT = 47
45 | SYS_PREAD = 50
46 | SYS_PWRITE = 51
47 | SYS_TSEMACQUIRE = 52
48 | SYS_NSEC = 53
49 | )
50 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/.gitignore:
--------------------------------------------------------------------------------
1 | _obj/
2 | unix.test
3 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/aliases.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 | // +build go1.9
8 |
9 | package unix
10 |
11 | import "syscall"
12 |
13 | type Signal = syscall.Signal
14 | type Errno = syscall.Errno
15 | type SysProcAttr = syscall.SysProcAttr
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go
12 | //
13 |
14 | TEXT ·syscall6(SB),NOSPLIT,$0-88
15 | JMP syscall·syscall6(SB)
16 |
17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88
18 | JMP syscall·rawSyscall6(SB)
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (freebsd || netbsd || openbsd) && gc
6 | // +build freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for 386 BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
6 | // +build darwin dragonfly freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for AMD64 BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (freebsd || netbsd || openbsd) && gc
6 | // +build freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for ARM BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-28
17 | B syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
20 | B syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
23 | B syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26 | B syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
29 | B syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc
6 | // +build darwin freebsd netbsd openbsd
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | // System call support for ARM64 BSD
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
23 | JMP syscall·Syscall9(SB)
24 |
25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26 | JMP syscall·RawSyscall(SB)
27 |
28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
29 | JMP syscall·RawSyscall6(SB)
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_386.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for 386, Linux
12 | //
13 |
14 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
15 | // instead of the glibc-specific "CALL 0x10(GS)".
16 | #define INVOKE_SYSCALL INT $0x80
17 |
18 | // Just jump to package syscall's implementation for all these functions.
19 | // The runtime may know about them.
20 |
21 | TEXT ·Syscall(SB),NOSPLIT,$0-28
22 | JMP syscall·Syscall(SB)
23 |
24 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
25 | JMP syscall·Syscall6(SB)
26 |
27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
28 | CALL runtime·entersyscall(SB)
29 | MOVL trap+0(FP), AX // syscall entry
30 | MOVL a1+4(FP), BX
31 | MOVL a2+8(FP), CX
32 | MOVL a3+12(FP), DX
33 | MOVL $0, SI
34 | MOVL $0, DI
35 | INVOKE_SYSCALL
36 | MOVL AX, r1+16(FP)
37 | MOVL DX, r2+20(FP)
38 | CALL runtime·exitsyscall(SB)
39 | RET
40 |
41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
42 | JMP syscall·RawSyscall(SB)
43 |
44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
45 | JMP syscall·RawSyscall6(SB)
46 |
47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
48 | MOVL trap+0(FP), AX // syscall entry
49 | MOVL a1+4(FP), BX
50 | MOVL a2+8(FP), CX
51 | MOVL a3+12(FP), DX
52 | MOVL $0, SI
53 | MOVL $0, DI
54 | INVOKE_SYSCALL
55 | MOVL AX, r1+16(FP)
56 | MOVL DX, r2+20(FP)
57 | RET
58 |
59 | TEXT ·socketcall(SB),NOSPLIT,$0-36
60 | JMP syscall·socketcall(SB)
61 |
62 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36
63 | JMP syscall·rawsocketcall(SB)
64 |
65 | TEXT ·seek(SB),NOSPLIT,$0-28
66 | JMP syscall·seek(SB)
67 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for AMD64, Linux
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | JMP syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | JMP syscall·Syscall6(SB)
22 |
23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
24 | CALL runtime·entersyscall(SB)
25 | MOVQ a1+8(FP), DI
26 | MOVQ a2+16(FP), SI
27 | MOVQ a3+24(FP), DX
28 | MOVQ $0, R10
29 | MOVQ $0, R8
30 | MOVQ $0, R9
31 | MOVQ trap+0(FP), AX // syscall entry
32 | SYSCALL
33 | MOVQ AX, r1+32(FP)
34 | MOVQ DX, r2+40(FP)
35 | CALL runtime·exitsyscall(SB)
36 | RET
37 |
38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
39 | JMP syscall·RawSyscall(SB)
40 |
41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
42 | JMP syscall·RawSyscall6(SB)
43 |
44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
45 | MOVQ a1+8(FP), DI
46 | MOVQ a2+16(FP), SI
47 | MOVQ a3+24(FP), DX
48 | MOVQ $0, R10
49 | MOVQ $0, R8
50 | MOVQ $0, R9
51 | MOVQ trap+0(FP), AX // syscall entry
52 | SYSCALL
53 | MOVQ AX, r1+32(FP)
54 | MOVQ DX, r2+40(FP)
55 | RET
56 |
57 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16
58 | JMP syscall·gettimeofday(SB)
59 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm.s:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for arm, Linux
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-28
18 | B syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
21 | B syscall·Syscall6(SB)
22 |
23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
24 | BL runtime·entersyscall(SB)
25 | MOVW trap+0(FP), R7
26 | MOVW a1+4(FP), R0
27 | MOVW a2+8(FP), R1
28 | MOVW a3+12(FP), R2
29 | MOVW $0, R3
30 | MOVW $0, R4
31 | MOVW $0, R5
32 | SWI $0
33 | MOVW R0, r1+16(FP)
34 | MOVW $0, R0
35 | MOVW R0, r2+20(FP)
36 | BL runtime·exitsyscall(SB)
37 | RET
38 |
39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
40 | B syscall·RawSyscall(SB)
41 |
42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
43 | B syscall·RawSyscall6(SB)
44 |
45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
46 | MOVW trap+0(FP), R7 // syscall entry
47 | MOVW a1+4(FP), R0
48 | MOVW a2+8(FP), R1
49 | MOVW a3+12(FP), R2
50 | SWI $0
51 | MOVW R0, r1+16(FP)
52 | MOVW $0, R0
53 | MOVW R0, r2+20(FP)
54 | RET
55 |
56 | TEXT ·seek(SB),NOSPLIT,$0-28
57 | B syscall·seek(SB)
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_arm64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && arm64 && gc
6 | // +build linux
7 | // +build arm64
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | // Just jump to package syscall's implementation for all these functions.
13 | // The runtime may know about them.
14 |
15 | TEXT ·Syscall(SB),NOSPLIT,$0-56
16 | B syscall·Syscall(SB)
17 |
18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
19 | B syscall·Syscall6(SB)
20 |
21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
22 | BL runtime·entersyscall(SB)
23 | MOVD a1+8(FP), R0
24 | MOVD a2+16(FP), R1
25 | MOVD a3+24(FP), R2
26 | MOVD $0, R3
27 | MOVD $0, R4
28 | MOVD $0, R5
29 | MOVD trap+0(FP), R8 // syscall entry
30 | SVC
31 | MOVD R0, r1+32(FP) // r1
32 | MOVD R1, r2+40(FP) // r2
33 | BL runtime·exitsyscall(SB)
34 | RET
35 |
36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
37 | B syscall·RawSyscall(SB)
38 |
39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
40 | B syscall·RawSyscall6(SB)
41 |
42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
43 | MOVD a1+8(FP), R0
44 | MOVD a2+16(FP), R1
45 | MOVD a3+24(FP), R2
46 | MOVD $0, R3
47 | MOVD $0, R4
48 | MOVD $0, R5
49 | MOVD trap+0(FP), R8 // syscall entry
50 | SVC
51 | MOVD R0, r1+32(FP)
52 | MOVD R1, r2+40(FP)
53 | RET
54 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_loong64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && loong64 && gc
6 | // +build linux
7 | // +build loong64
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 |
13 | // Just jump to package syscall's implementation for all these functions.
14 | // The runtime may know about them.
15 |
16 | TEXT ·Syscall(SB),NOSPLIT,$0-56
17 | JMP syscall·Syscall(SB)
18 |
19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
20 | JMP syscall·Syscall6(SB)
21 |
22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
23 | JAL runtime·entersyscall(SB)
24 | MOVV a1+8(FP), R4
25 | MOVV a2+16(FP), R5
26 | MOVV a3+24(FP), R6
27 | MOVV R0, R7
28 | MOVV R0, R8
29 | MOVV R0, R9
30 | MOVV trap+0(FP), R11 // syscall entry
31 | SYSCALL
32 | MOVV R4, r1+32(FP)
33 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0
34 | JAL runtime·exitsyscall(SB)
35 | RET
36 |
37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
38 | JMP syscall·RawSyscall(SB)
39 |
40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
41 | JMP syscall·RawSyscall6(SB)
42 |
43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
44 | MOVV a1+8(FP), R4
45 | MOVV a2+16(FP), R5
46 | MOVV a3+24(FP), R6
47 | MOVV R0, R7
48 | MOVV R0, R8
49 | MOVV R0, R9
50 | MOVV trap+0(FP), R11 // syscall entry
51 | SYSCALL
52 | MOVV R4, r1+32(FP)
53 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0
54 | RET
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (mips64 || mips64le) && gc
6 | // +build linux
7 | // +build mips64 mips64le
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for mips64, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·Syscall(SB),NOSPLIT,$0-56
20 | JMP syscall·Syscall(SB)
21 |
22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
23 | JMP syscall·Syscall6(SB)
24 |
25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
26 | JAL runtime·entersyscall(SB)
27 | MOVV a1+8(FP), R4
28 | MOVV a2+16(FP), R5
29 | MOVV a3+24(FP), R6
30 | MOVV R0, R7
31 | MOVV R0, R8
32 | MOVV R0, R9
33 | MOVV trap+0(FP), R2 // syscall entry
34 | SYSCALL
35 | MOVV R2, r1+32(FP)
36 | MOVV R3, r2+40(FP)
37 | JAL runtime·exitsyscall(SB)
38 | RET
39 |
40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
41 | JMP syscall·RawSyscall(SB)
42 |
43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
44 | JMP syscall·RawSyscall6(SB)
45 |
46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
47 | MOVV a1+8(FP), R4
48 | MOVV a2+16(FP), R5
49 | MOVV a3+24(FP), R6
50 | MOVV R0, R7
51 | MOVV R0, R8
52 | MOVV R0, R9
53 | MOVV trap+0(FP), R2 // syscall entry
54 | SYSCALL
55 | MOVV R2, r1+32(FP)
56 | MOVV R3, r2+40(FP)
57 | RET
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (mips || mipsle) && gc
6 | // +build linux
7 | // +build mips mipsle
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for mips, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·Syscall(SB),NOSPLIT,$0-28
20 | JMP syscall·Syscall(SB)
21 |
22 | TEXT ·Syscall6(SB),NOSPLIT,$0-40
23 | JMP syscall·Syscall6(SB)
24 |
25 | TEXT ·Syscall9(SB),NOSPLIT,$0-52
26 | JMP syscall·Syscall9(SB)
27 |
28 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
29 | JAL runtime·entersyscall(SB)
30 | MOVW a1+4(FP), R4
31 | MOVW a2+8(FP), R5
32 | MOVW a3+12(FP), R6
33 | MOVW R0, R7
34 | MOVW trap+0(FP), R2 // syscall entry
35 | SYSCALL
36 | MOVW R2, r1+16(FP) // r1
37 | MOVW R3, r2+20(FP) // r2
38 | JAL runtime·exitsyscall(SB)
39 | RET
40 |
41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28
42 | JMP syscall·RawSyscall(SB)
43 |
44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
45 | JMP syscall·RawSyscall6(SB)
46 |
47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
48 | MOVW a1+4(FP), R4
49 | MOVW a2+8(FP), R5
50 | MOVW a3+12(FP), R6
51 | MOVW trap+0(FP), R2 // syscall entry
52 | SYSCALL
53 | MOVW R2, r1+16(FP)
54 | MOVW R3, r2+20(FP)
55 | RET
56 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (ppc64 || ppc64le) && gc
6 | // +build linux
7 | // +build ppc64 ppc64le
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for ppc64, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
20 | BL runtime·entersyscall(SB)
21 | MOVD a1+8(FP), R3
22 | MOVD a2+16(FP), R4
23 | MOVD a3+24(FP), R5
24 | MOVD R0, R6
25 | MOVD R0, R7
26 | MOVD R0, R8
27 | MOVD trap+0(FP), R9 // syscall entry
28 | SYSCALL R9
29 | MOVD R3, r1+32(FP)
30 | MOVD R4, r2+40(FP)
31 | BL runtime·exitsyscall(SB)
32 | RET
33 |
34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
35 | MOVD a1+8(FP), R3
36 | MOVD a2+16(FP), R4
37 | MOVD a3+24(FP), R5
38 | MOVD R0, R6
39 | MOVD R0, R7
40 | MOVD R0, R8
41 | MOVD trap+0(FP), R9 // syscall entry
42 | SYSCALL R9
43 | MOVD R3, r1+32(FP)
44 | MOVD R4, r2+40(FP)
45 | RET
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build riscv64 && gc
6 | // +build riscv64
7 | // +build gc
8 |
9 | #include "textflag.h"
10 |
11 | //
12 | // System calls for linux/riscv64.
13 | //
14 | // Where available, just jump to package syscall's implementation of
15 | // these functions.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | JMP syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | JMP syscall·Syscall6(SB)
22 |
23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
24 | CALL runtime·entersyscall(SB)
25 | MOV a1+8(FP), A0
26 | MOV a2+16(FP), A1
27 | MOV a3+24(FP), A2
28 | MOV trap+0(FP), A7 // syscall entry
29 | ECALL
30 | MOV A0, r1+32(FP) // r1
31 | MOV A1, r2+40(FP) // r2
32 | CALL runtime·exitsyscall(SB)
33 | RET
34 |
35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
36 | JMP syscall·RawSyscall(SB)
37 |
38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
39 | JMP syscall·RawSyscall6(SB)
40 |
41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
42 | MOV a1+8(FP), A0
43 | MOV a2+16(FP), A1
44 | MOV a3+24(FP), A2
45 | MOV trap+0(FP), A7 // syscall entry
46 | ECALL
47 | MOV A0, r1+32(FP)
48 | MOV A1, r2+40(FP)
49 | RET
50 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_linux_s390x.s:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && s390x && gc
6 | // +build linux
7 | // +build s390x
8 | // +build gc
9 |
10 | #include "textflag.h"
11 |
12 | //
13 | // System calls for s390x, Linux
14 | //
15 |
16 | // Just jump to package syscall's implementation for all these functions.
17 | // The runtime may know about them.
18 |
19 | TEXT ·Syscall(SB),NOSPLIT,$0-56
20 | BR syscall·Syscall(SB)
21 |
22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
23 | BR syscall·Syscall6(SB)
24 |
25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
26 | BL runtime·entersyscall(SB)
27 | MOVD a1+8(FP), R2
28 | MOVD a2+16(FP), R3
29 | MOVD a3+24(FP), R4
30 | MOVD $0, R5
31 | MOVD $0, R6
32 | MOVD $0, R7
33 | MOVD trap+0(FP), R1 // syscall entry
34 | SYSCALL
35 | MOVD R2, r1+32(FP)
36 | MOVD R3, r2+40(FP)
37 | BL runtime·exitsyscall(SB)
38 | RET
39 |
40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
41 | BR syscall·RawSyscall(SB)
42 |
43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
44 | BR syscall·RawSyscall6(SB)
45 |
46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
47 | MOVD a1+8(FP), R2
48 | MOVD a2+16(FP), R3
49 | MOVD a3+24(FP), R4
50 | MOVD $0, R5
51 | MOVD $0, R6
52 | MOVD $0, R7
53 | MOVD trap+0(FP), R1 // syscall entry
54 | SYSCALL
55 | MOVD R2, r1+32(FP)
56 | MOVD R3, r2+40(FP)
57 | RET
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System call support for mips64, OpenBSD
12 | //
13 |
14 | // Just jump to package syscall's implementation for all these functions.
15 | // The runtime may know about them.
16 |
17 | TEXT ·Syscall(SB),NOSPLIT,$0-56
18 | JMP syscall·Syscall(SB)
19 |
20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80
21 | JMP syscall·Syscall6(SB)
22 |
23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104
24 | JMP syscall·Syscall9(SB)
25 |
26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56
27 | JMP syscall·RawSyscall(SB)
28 |
29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
30 | JMP syscall·RawSyscall6(SB)
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gc
6 | // +build gc
7 |
8 | #include "textflag.h"
9 |
10 | //
11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go
12 | //
13 |
14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88
15 | JMP syscall·sysvicall6(SB)
16 |
17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88
18 | JMP syscall·rawSysvicall6(SB)
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/bluetooth_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Bluetooth sockets and messages
6 |
7 | package unix
8 |
9 | // Bluetooth Protocols
10 | const (
11 | BTPROTO_L2CAP = 0
12 | BTPROTO_HCI = 1
13 | BTPROTO_SCO = 2
14 | BTPROTO_RFCOMM = 3
15 | BTPROTO_BNEP = 4
16 | BTPROTO_CMTP = 5
17 | BTPROTO_HIDP = 6
18 | BTPROTO_AVDTP = 7
19 | )
20 |
21 | const (
22 | HCI_CHANNEL_RAW = 0
23 | HCI_CHANNEL_USER = 1
24 | HCI_CHANNEL_MONITOR = 2
25 | HCI_CHANNEL_CONTROL = 3
26 | HCI_CHANNEL_LOGGING = 4
27 | )
28 |
29 | // Socketoption Level
30 | const (
31 | SOL_BLUETOOTH = 0x112
32 | SOL_HCI = 0x0
33 | SOL_L2CAP = 0x6
34 | SOL_RFCOMM = 0x12
35 | SOL_SCO = 0x11
36 | )
37 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/constants.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 |
8 | package unix
9 |
10 | const (
11 | R_OK = 0x4
12 | W_OK = 0x2
13 | X_OK = 0x1
14 | )
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix && ppc
6 | // +build aix,ppc
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used by AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev >> 16) & 0xffff)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32(dev & 0xffff)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | return uint64(((major) << 16) | (minor))
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix && ppc64
6 | // +build aix,ppc64
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used AIX.
10 |
11 | package unix
12 |
13 | // Major returns the major component of a Linux device number.
14 | func Major(dev uint64) uint32 {
15 | return uint32((dev & 0x3fffffff00000000) >> 32)
16 | }
17 |
18 | // Minor returns the minor component of a Linux device number.
19 | func Minor(dev uint64) uint32 {
20 | return uint32((dev & 0x00000000ffffffff) >> 0)
21 | }
22 |
23 | // Mkdev returns a Linux device number generated from the given major and minor
24 | // components.
25 | func Mkdev(major, minor uint32) uint64 {
26 | var DEVNO64 uint64
27 | DEVNO64 = 0x8000000000000000
28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Darwin's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a Darwin device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev >> 24) & 0xff)
13 | }
14 |
15 | // Minor returns the minor component of a Darwin device number.
16 | func Minor(dev uint64) uint32 {
17 | return uint32(dev & 0xffffff)
18 | }
19 |
20 | // Mkdev returns a Darwin device number generated from the given major and minor
21 | // components.
22 | func Mkdev(major, minor uint32) uint64 {
23 | return (uint64(major) << 24) | uint64(minor)
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in Dragonfly's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a DragonFlyBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a DragonFlyBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_freebsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in FreeBSD's sys/types.h header.
7 | //
8 | // The information below is extracted and adapted from sys/types.h:
9 | //
10 | // Minor gives a cookie instead of an index since in order to avoid changing the
11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
12 | // devices that don't use them.
13 |
14 | package unix
15 |
16 | // Major returns the major component of a FreeBSD device number.
17 | func Major(dev uint64) uint32 {
18 | return uint32((dev >> 8) & 0xff)
19 | }
20 |
21 | // Minor returns the minor component of a FreeBSD device number.
22 | func Minor(dev uint64) uint32 {
23 | return uint32(dev & 0xffff00ff)
24 | }
25 |
26 | // Mkdev returns a FreeBSD device number generated from the given major and
27 | // minor components.
28 | func Mkdev(major, minor uint32) uint64 {
29 | return (uint64(major) << 8) | uint64(minor)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used by the Linux kernel and glibc.
7 | //
8 | // The information below is extracted and adapted from bits/sysmacros.h in the
9 | // glibc sources:
10 | //
11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
13 | // number and m is a hex digit of the minor number. This is backward compatible
14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
15 | // backward compatible with the Linux kernel, which for some architectures uses
16 | // 32-bit dev_t, encoded as mmmM MMmm.
17 |
18 | package unix
19 |
20 | // Major returns the major component of a Linux device number.
21 | func Major(dev uint64) uint32 {
22 | major := uint32((dev & 0x00000000000fff00) >> 8)
23 | major |= uint32((dev & 0xfffff00000000000) >> 32)
24 | return major
25 | }
26 |
27 | // Minor returns the minor component of a Linux device number.
28 | func Minor(dev uint64) uint32 {
29 | minor := uint32((dev & 0x00000000000000ff) >> 0)
30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12)
31 | return minor
32 | }
33 |
34 | // Mkdev returns a Linux device number generated from the given major and minor
35 | // components.
36 | func Mkdev(major, minor uint32) uint64 {
37 | dev := (uint64(major) & 0x00000fff) << 8
38 | dev |= (uint64(major) & 0xfffff000) << 32
39 | dev |= (uint64(minor) & 0x000000ff) << 0
40 | dev |= (uint64(minor) & 0xffffff00) << 12
41 | return dev
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_netbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in NetBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of a NetBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x000fff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of a NetBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xfff00000) >> 12)
19 | return minor
20 | }
21 |
22 | // Mkdev returns a NetBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x000fff00
26 | dev |= (uint64(minor) << 12) & 0xfff00000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Functions to access/create device major and minor numbers matching the
6 | // encoding used in OpenBSD's sys/types.h header.
7 |
8 | package unix
9 |
10 | // Major returns the major component of an OpenBSD device number.
11 | func Major(dev uint64) uint32 {
12 | return uint32((dev & 0x0000ff00) >> 8)
13 | }
14 |
15 | // Minor returns the minor component of an OpenBSD device number.
16 | func Minor(dev uint64) uint32 {
17 | minor := uint32((dev & 0x000000ff) >> 0)
18 | minor |= uint32((dev & 0xffff0000) >> 8)
19 | return minor
20 | }
21 |
22 | // Mkdev returns an OpenBSD device number generated from the given major and minor
23 | // components.
24 | func Mkdev(major, minor uint32) uint64 {
25 | dev := (uint64(major) << 8) & 0x0000ff00
26 | dev |= (uint64(minor) << 8) & 0xffff0000
27 | dev |= (uint64(minor) << 0) & 0x000000ff
28 | return dev
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/dev_zos.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build zos && s390x
6 | // +build zos,s390x
7 |
8 | // Functions to access/create device major and minor numbers matching the
9 | // encoding used by z/OS.
10 | //
11 | // The information below is extracted and adapted from macros.
12 |
13 | package unix
14 |
15 | // Major returns the major component of a z/OS device number.
16 | func Major(dev uint64) uint32 {
17 | return uint32((dev >> 16) & 0x0000FFFF)
18 | }
19 |
20 | // Minor returns the minor component of a z/OS device number.
21 | func Minor(dev uint64) uint32 {
22 | return uint32(dev & 0x0000FFFF)
23 | }
24 |
25 | // Mkdev returns a z/OS device number generated from the given major and minor
26 | // components.
27 | func Mkdev(major, minor uint32) uint64 {
28 | return (uint64(major) << 16) | uint64(minor)
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/endian_big.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 | //
5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
7 |
8 | package unix
9 |
10 | const isBigEndian = true
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/endian_little.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 | //
5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
6 | // +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
7 |
8 | package unix
9 |
10 | const isBigEndian = false
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/env_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 |
8 | // Unix environment variables.
9 |
10 | package unix
11 |
12 | import "syscall"
13 |
14 | func Getenv(key string) (value string, found bool) {
15 | return syscall.Getenv(key)
16 | }
17 |
18 | func Setenv(key, value string) error {
19 | return syscall.Setenv(key, value)
20 | }
21 |
22 | func Clearenv() {
23 | syscall.Clearenv()
24 | }
25 |
26 | func Environ() []string {
27 | return syscall.Environ()
28 | }
29 |
30 | func Unsetenv(key string) error {
31 | return syscall.Unsetenv(key)
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
6 | // them here for backwards compatibility.
7 |
8 | package unix
9 |
10 | const (
11 | DLT_HHDLC = 0x79
12 | IPV6_MIN_MEMBERSHIPS = 0x1f
13 | IP_MAX_SOURCE_FILTER = 0x400
14 | IP_MIN_MEMBERSHIPS = 0x1f
15 | RT_CACHING_CONTEXT = 0x1
16 | RT_NORTREF = 0x2
17 | )
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd
6 | // +build dragonfly freebsd linux netbsd openbsd
7 |
8 | package unix
9 |
10 | import "unsafe"
11 |
12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64.
14 | var fcntl64Syscall uintptr = SYS_FCNTL
15 |
16 | func fcntl(fd int, cmd, arg int) (int, error) {
17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg))
18 | var err error
19 | if errno != 0 {
20 | err = errno
21 | }
22 | return int(valptr), err
23 | }
24 |
25 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
27 | return fcntl(int(fd), cmd, arg)
28 | }
29 |
30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
33 | if errno == 0 {
34 | return nil
35 | }
36 | return errno
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import "unsafe"
8 |
9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument.
10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
11 | return fcntl(int(fd), cmd, arg)
12 | }
13 |
14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
17 | return err
18 | }
19 |
20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command.
21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error {
22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore))))
23 | return err
24 | }
25 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc)
6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc
7 |
8 | package unix
9 |
10 | func init() {
11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's
12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL.
13 | fcntl64Syscall = SYS_FCNTL64
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/fdset.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
7 |
8 | package unix
9 |
10 | // Set adds fd to the set fds.
11 | func (fds *FdSet) Set(fd int) {
12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS))
13 | }
14 |
15 | // Clear removes fd from the set fds.
16 | func (fds *FdSet) Clear(fd int) {
17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS))
18 | }
19 |
20 | // IsSet returns whether fd is in the set fds.
21 | func (fds *FdSet) IsSet(fd int) bool {
22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0
23 | }
24 |
25 | // Zero clears the set fds.
26 | func (fds *FdSet) Zero() {
27 | for i := range fds.Bits {
28 | fds.Bits[i] = 0
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_c.c:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // +build gccgo
6 | // +build !aix
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | #define _STRINGIFY2_(x) #x
13 | #define _STRINGIFY_(x) _STRINGIFY2_(x)
14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
15 |
16 | // Call syscall from C code because the gccgo support for calling from
17 | // Go to C does not support varargs functions.
18 |
19 | struct ret {
20 | uintptr_t r;
21 | uintptr_t err;
22 | };
23 |
24 | struct ret gccgoRealSyscall(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)
25 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall");
26 |
27 | struct ret
28 | gccgoRealSyscall(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)
29 | {
30 | struct ret r;
31 |
32 | errno = 0;
33 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
34 | r.err = errno;
35 | return r;
36 | }
37 |
38 | 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)
39 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError");
40 |
41 | uintptr_t
42 | 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)
43 | {
44 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
45 | }
46 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build gccgo && linux && amd64
6 | // +build gccgo,linux,amd64
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | //extern gettimeofday
13 | func realGettimeofday(*Timeval, *byte) int32
14 |
15 | func gettimeofday(tv *Timeval) (err syscall.Errno) {
16 | r := realGettimeofday(tv, nil)
17 | if r < 0 {
18 | return syscall.GetErrno()
19 | }
20 | return 0
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/pagesize_unix.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
7 |
8 | // For Unix, get the pagesize from the runtime.
9 |
10 | package unix
11 |
12 | import "syscall"
13 |
14 | func Getpagesize() int {
15 | return syscall.Getpagesize()
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ptrace_darwin.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && !ios
6 | // +build darwin,!ios
7 |
8 | package unix
9 |
10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error {
11 | return ptrace1(request, pid, addr, data)
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ptrace_ios.go:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build ios
6 | // +build ios
7 |
8 | package unix
9 |
10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
11 | return ENOTSUP
12 | }
13 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin && race) || (linux && race) || (freebsd && race)
6 | // +build darwin,race linux,race freebsd,race
7 |
8 | package unix
9 |
10 | import (
11 | "runtime"
12 | "unsafe"
13 | )
14 |
15 | const raceenabled = true
16 |
17 | func raceAcquire(addr unsafe.Pointer) {
18 | runtime.RaceAcquire(addr)
19 | }
20 |
21 | func raceReleaseMerge(addr unsafe.Pointer) {
22 | runtime.RaceReleaseMerge(addr)
23 | }
24 |
25 | func raceReadRange(addr unsafe.Pointer, len int) {
26 | runtime.RaceReadRange(addr, len)
27 | }
28 |
29 | func raceWriteRange(addr unsafe.Pointer, len int) {
30 | runtime.RaceWriteRange(addr, len)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/race0.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos
6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos
7 |
8 | package unix
9 |
10 | import (
11 | "unsafe"
12 | )
13 |
14 | const raceenabled = false
15 |
16 | func raceAcquire(addr unsafe.Pointer) {
17 | }
18 |
19 | func raceReleaseMerge(addr unsafe.Pointer) {
20 | }
21 |
22 | func raceReadRange(addr unsafe.Pointer, len int) {
23 | }
24 |
25 | func raceWriteRange(addr unsafe.Pointer, len int) {
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/readdirent_getdents.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd
6 | // +build aix dragonfly freebsd linux netbsd openbsd
7 |
8 | package unix
9 |
10 | // ReadDirent reads directory entries from fd and writes them into buf.
11 | func ReadDirent(fd int, buf []byte) (n int, err error) {
12 | return Getdents(fd, buf)
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin
6 | // +build darwin
7 |
8 | package unix
9 |
10 | import "unsafe"
11 |
12 | // ReadDirent reads directory entries from fd and writes them into buf.
13 | func ReadDirent(fd int, buf []byte) (n int, err error) {
14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil.
15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the
16 | // actual system call is getdirentries64, 64 is a good guess.
17 | // TODO(rsc): Can we use a single global basep for all calls?
18 | var base = (*uintptr)(unsafe.Pointer(new(uint64)))
19 | return Getdirentries(fd, buf, base)
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | // Round the length of a raw sockaddr up to align it properly.
8 | func cmsgAlignOf(salen int) int {
9 | salign := SizeofPtr
10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) {
11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires
12 | // 32-bit aligned access to network subsystem.
13 | salign = 4
14 | }
15 | return (salen + salign - 1) & ^(salign - 1)
16 | }
17 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos
6 | // +build aix darwin freebsd linux netbsd openbsd solaris zos
7 |
8 | package unix
9 |
10 | import (
11 | "runtime"
12 | )
13 |
14 | // Round the length of a raw sockaddr up to align it properly.
15 | func cmsgAlignOf(salen int) int {
16 | salign := SizeofPtr
17 |
18 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in
19 | // sockcmsg_dragonfly.go
20 | switch runtime.GOOS {
21 | case "aix":
22 | // There is no alignment on AIX.
23 | salign = 1
24 | case "darwin", "ios", "illumos", "solaris":
25 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris
26 | // kernels still require 32-bit aligned access to network
27 | // subsystem.
28 | if SizeofPtr == 8 {
29 | salign = 4
30 | }
31 | case "netbsd", "openbsd":
32 | // NetBSD and OpenBSD armv7 require 64-bit alignment.
33 | if runtime.GOARCH == "arm" {
34 | salign = 8
35 | }
36 | // NetBSD aarch64 requires 128-bit alignment.
37 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" {
38 | salign = 16
39 | }
40 | case "zos":
41 | // z/OS socket macros use [32-bit] sizeof(int) alignment,
42 | // not pointer width.
43 | salign = SizeofInt
44 | }
45 |
46 | return (salen + salign - 1) & ^(salign - 1)
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/str.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
7 |
8 | package unix
9 |
10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency
11 | if val < 0 {
12 | return "-" + uitoa(uint(-val))
13 | }
14 | return uitoa(uint(val))
15 | }
16 |
17 | func uitoa(val uint) string {
18 | var buf [32]byte // big enough for int64
19 | i := len(buf) - 1
20 | for val >= 10 {
21 | buf[i] = byte(val%10 + '0')
22 | i--
23 | val /= 10
24 | }
25 | buf[i] = byte(val + '0')
26 | return string(buf[i:])
27 | }
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix && ppc
6 | // +build aix,ppc
7 |
8 | package unix
9 |
10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
13 |
14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
15 |
16 | func setTimespec(sec, nsec int64) Timespec {
17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
18 | }
19 |
20 | func setTimeval(sec, usec int64) Timeval {
21 | return Timeval{Sec: int32(sec), Usec: int32(usec)}
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = int32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | func Fstat(fd int, stat *Stat_t) error {
41 | return fstat(fd, stat)
42 | }
43 |
44 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error {
45 | return fstatat(dirfd, path, stat, flags)
46 | }
47 |
48 | func Lstat(path string, stat *Stat_t) error {
49 | return lstat(path, stat)
50 | }
51 |
52 | func Stat(path string, statptr *Stat_t) error {
53 | return stat(path, statptr)
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && go1.12 && !go1.13
6 | // +build darwin,go1.12,!go1.13
7 |
8 | package unix
9 |
10 | import (
11 | "unsafe"
12 | )
13 |
14 | const _SYS_GETDIRENTRIES64 = 344
15 |
16 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
17 | // To implement this using libSystem we'd need syscall_syscallPtr for
18 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
19 | // back to raw syscalls for this func on Go 1.12.
20 | var p unsafe.Pointer
21 | if len(buf) > 0 {
22 | p = unsafe.Pointer(&buf[0])
23 | } else {
24 | p = unsafe.Pointer(&_zero)
25 | }
26 | r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
27 | n = int(r0)
28 | if e1 != 0 {
29 | return n, errnoErr(e1)
30 | }
31 | return n, nil
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build amd64 && darwin
6 | // +build amd64,darwin
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | func setTimespec(sec, nsec int64) Timespec {
13 | return Timespec{Sec: sec, Nsec: nsec}
14 | }
15 |
16 | func setTimeval(sec, usec int64) Timeval {
17 | return Timeval{Sec: sec, Usec: int32(usec)}
18 | }
19 |
20 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
21 | k.Ident = uint64(fd)
22 | k.Filter = int16(mode)
23 | k.Flags = uint16(flags)
24 | }
25 |
26 | func (iov *Iovec) SetLen(length int) {
27 | iov.Len = uint64(length)
28 | }
29 |
30 | func (msghdr *Msghdr) SetControllen(length int) {
31 | msghdr.Controllen = uint32(length)
32 | }
33 |
34 | func (msghdr *Msghdr) SetIovlen(length int) {
35 | msghdr.Iovlen = int32(length)
36 | }
37 |
38 | func (cmsg *Cmsghdr) SetLen(length int) {
39 | cmsg.Len = uint32(length)
40 | }
41 |
42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
43 |
44 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
48 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
50 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
51 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build arm64 && darwin
6 | // +build arm64,darwin
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | func setTimespec(sec, nsec int64) Timespec {
13 | return Timespec{Sec: sec, Nsec: nsec}
14 | }
15 |
16 | func setTimeval(sec, usec int64) Timeval {
17 | return Timeval{Sec: sec, Usec: int32(usec)}
18 | }
19 |
20 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
21 | k.Ident = uint64(fd)
22 | k.Filter = int16(mode)
23 | k.Flags = uint16(flags)
24 | }
25 |
26 | func (iov *Iovec) SetLen(length int) {
27 | iov.Len = uint64(length)
28 | }
29 |
30 | func (msghdr *Msghdr) SetControllen(length int) {
31 | msghdr.Controllen = uint32(length)
32 | }
33 |
34 | func (msghdr *Msghdr) SetIovlen(length int) {
35 | msghdr.Iovlen = int32(length)
36 | }
37 |
38 | func (cmsg *Cmsghdr) SetLen(length int) {
39 | cmsg.Len = uint32(length)
40 | }
41 |
42 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
43 |
44 | //sys Fstat(fd int, stat *Stat_t) (err error)
45 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
46 | //sys Fstatfs(fd int, stat *Statfs_t) (err error)
47 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
48 | //sys Lstat(path string, stat *Stat_t) (err error)
49 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
50 | //sys Stat(path string, stat *Stat_t) (err error)
51 | //sys Statfs(path string, stat *Statfs_t) (err error)
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && go1.12
6 | // +build darwin,go1.12
7 |
8 | package unix
9 |
10 | import _ "unsafe"
11 |
12 | // Implemented in the runtime package (runtime/sys_darwin.go)
13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
15 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
16 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only
17 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
18 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
19 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
20 |
21 | //go:linkname syscall_syscall syscall.syscall
22 | //go:linkname syscall_syscall6 syscall.syscall6
23 | //go:linkname syscall_syscall6X syscall.syscall6X
24 | //go:linkname syscall_syscall9 syscall.syscall9
25 | //go:linkname syscall_rawSyscall syscall.rawSyscall
26 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6
27 | //go:linkname syscall_syscallPtr syscall.syscallPtr
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build amd64 && dragonfly
6 | // +build amd64,dragonfly
7 |
8 | package unix
9 |
10 | import (
11 | "syscall"
12 | "unsafe"
13 | )
14 |
15 | func setTimespec(sec, nsec int64) Timespec {
16 | return Timespec{Sec: sec, Nsec: nsec}
17 | }
18 |
19 | func setTimeval(sec, usec int64) Timeval {
20 | return Timeval{Sec: sec, Usec: usec}
21 | }
22 |
23 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
24 | k.Ident = uint64(fd)
25 | k.Filter = int16(mode)
26 | k.Flags = uint16(flags)
27 | }
28 |
29 | func (iov *Iovec) SetLen(length int) {
30 | iov.Len = uint64(length)
31 | }
32 |
33 | func (msghdr *Msghdr) SetControllen(length int) {
34 | msghdr.Controllen = uint32(length)
35 | }
36 |
37 | func (msghdr *Msghdr) SetIovlen(length int) {
38 | msghdr.Iovlen = int32(length)
39 | }
40 |
41 | func (cmsg *Cmsghdr) SetLen(length int) {
42 | cmsg.Len = uint32(length)
43 | }
44 |
45 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
46 | var writtenOut uint64 = 0
47 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
48 |
49 | written = int(writtenOut)
50 |
51 | if e1 != 0 {
52 | err = e1
53 | }
54 | return
55 | }
56 |
57 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
58 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64)
6 | // +build linux
7 | // +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64
8 |
9 | package unix
10 |
11 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH
12 | // values.
13 |
14 | //sys Alarm(seconds uint) (remaining uint, err error)
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build amd64 && linux && gc
6 | // +build amd64,linux,gc
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | //go:noescape
13 | func gettimeofday(tv *Timeval) (err syscall.Errno)
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && gc
6 | // +build linux,gc
7 |
8 | package unix
9 |
10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail.
11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
12 |
13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't
14 | // fail.
15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
16 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && gc && 386
6 | // +build linux,gc,386
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | // Underlying system call writes to newoffset via pointer.
13 | // Implemented in assembly to avoid allocation.
14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
15 |
16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno)
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build arm && gc && linux
6 | // +build arm,gc,linux
7 |
8 | package unix
9 |
10 | import "syscall"
11 |
12 | // Underlying system call writes to newoffset via pointer.
13 | // Implemented in assembly to avoid allocation.
14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && gccgo && 386
6 | // +build linux,gccgo,386
7 |
8 | package unix
9 |
10 | import (
11 | "syscall"
12 | "unsafe"
13 | )
14 |
15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
16 | var newoffset int64
17 | offsetLow := uint32(offset & 0xffffffff)
18 | offsetHigh := uint32((offset >> 32) & 0xffffffff)
19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
20 | return newoffset, err
21 | }
22 |
23 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
24 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
25 | return int(fd), err
26 | }
27 |
28 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) {
29 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0)
30 | return int(fd), err
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && gccgo && arm
6 | // +build linux,gccgo,arm
7 |
8 | package unix
9 |
10 | import (
11 | "syscall"
12 | "unsafe"
13 | )
14 |
15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) {
16 | var newoffset int64
17 | offsetLow := uint32(offset & 0xffffffff)
18 | offsetHigh := uint32((offset >> 32) & 0xffffffff)
19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
20 | return newoffset, err
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build 386 && netbsd
6 | // +build 386,netbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: int32(nsec)}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: int32(usec)}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint32(fd)
20 | k.Filter = uint32(mode)
21 | k.Flags = uint32(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = int32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build amd64 && netbsd
6 | // +build amd64,netbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: nsec}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: int32(usec)}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint64(fd)
20 | k.Filter = uint32(mode)
21 | k.Flags = uint32(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint64(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = int32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build arm && netbsd
6 | // +build arm,netbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: int32(nsec)}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: int32(usec)}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint32(fd)
20 | k.Filter = uint32(mode)
21 | k.Flags = uint32(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = int32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build arm64 && netbsd
6 | // +build arm64,netbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: nsec}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: int32(usec)}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint64(fd)
20 | k.Filter = uint32(mode)
21 | k.Flags = uint32(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint64(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = int32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build 386 && openbsd
6 | // +build 386,openbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: int32(nsec)}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: int32(usec)}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint32(fd)
20 | k.Filter = int16(mode)
21 | k.Flags = uint16(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
41 | // of openbsd/386 the syscall is called sysctl instead of __sysctl.
42 | const SYS___SYSCTL = SYS_SYSCTL
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build amd64 && openbsd
6 | // +build amd64,openbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: nsec}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: usec}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint64(fd)
20 | k.Filter = int16(mode)
21 | k.Flags = uint16(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint64(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
42 | const SYS___SYSCTL = SYS_SYSCTL
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build arm && openbsd
6 | // +build arm,openbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: int32(nsec)}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: int32(usec)}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint32(fd)
20 | k.Filter = int16(mode)
21 | k.Flags = uint16(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint32(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
41 | // of openbsd/arm the syscall is called sysctl instead of __sysctl.
42 | const SYS___SYSCTL = SYS_SYSCTL
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build arm64 && openbsd
6 | // +build arm64,openbsd
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: nsec}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: usec}
16 | }
17 |
18 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
19 | k.Ident = uint64(fd)
20 | k.Filter = int16(mode)
21 | k.Flags = uint16(flags)
22 | }
23 |
24 | func (iov *Iovec) SetLen(length int) {
25 | iov.Len = uint64(length)
26 | }
27 |
28 | func (msghdr *Msghdr) SetControllen(length int) {
29 | msghdr.Controllen = uint32(length)
30 | }
31 |
32 | func (msghdr *Msghdr) SetIovlen(length int) {
33 | msghdr.Iovlen = uint32(length)
34 | }
35 |
36 | func (cmsg *Cmsghdr) SetLen(length int) {
37 | cmsg.Len = uint32(length)
38 | }
39 |
40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl.
42 | const SYS___SYSCTL = SYS_SYSCTL
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | func setTimespec(sec, nsec int64) Timespec {
8 | return Timespec{Sec: sec, Nsec: nsec}
9 | }
10 |
11 | func setTimeval(sec, usec int64) Timeval {
12 | return Timeval{Sec: sec, Usec: usec}
13 | }
14 |
15 | func SetKevent(k *Kevent_t, fd, mode, flags int) {
16 | k.Ident = uint64(fd)
17 | k.Filter = int16(mode)
18 | k.Flags = uint16(flags)
19 | }
20 |
21 | func (iov *Iovec) SetLen(length int) {
22 | iov.Len = uint64(length)
23 | }
24 |
25 | func (msghdr *Msghdr) SetControllen(length int) {
26 | msghdr.Controllen = uint32(length)
27 | }
28 |
29 | func (cmsg *Cmsghdr) SetLen(length int) {
30 | cmsg.Len = uint32(length)
31 | }
32 |
33 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
34 | // of OpenBSD the syscall is called sysctl instead of __sysctl.
35 | const SYS___SYSCTL = SYS_SYSCTL
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build amd64 && solaris
6 | // +build amd64,solaris
7 |
8 | package unix
9 |
10 | func setTimespec(sec, nsec int64) Timespec {
11 | return Timespec{Sec: sec, Nsec: nsec}
12 | }
13 |
14 | func setTimeval(sec, usec int64) Timeval {
15 | return Timeval{Sec: sec, Usec: usec}
16 | }
17 |
18 | func (iov *Iovec) SetLen(length int) {
19 | iov.Len = uint64(length)
20 | }
21 |
22 | func (msghdr *Msghdr) SetIovlen(length int) {
23 | msghdr.Iovlen = int32(length)
24 | }
25 |
26 | func (cmsg *Cmsghdr) SetLen(length int) {
27 | cmsg.Len = uint32(length)
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64
6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris
7 | // +build gc
8 | // +build !ppc64le
9 | // +build !ppc64
10 |
11 | package unix
12 |
13 | import "syscall"
14 |
15 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
18 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
19 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux && (ppc64le || ppc64) && gc
6 | // +build linux
7 | // +build ppc64le ppc64
8 | // +build gc
9 |
10 | package unix
11 |
12 | import "syscall"
13 |
14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
15 | return syscall.Syscall(trap, a1, a2, a3)
16 | }
17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6)
19 | }
20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
21 | return syscall.RawSyscall(trap, a1, a2, a3)
22 | }
23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6)
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sysvshm_linux.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build linux
6 | // +build linux
7 |
8 | package unix
9 |
10 | import "runtime"
11 |
12 | // SysvShmCtl performs control operations on the shared memory segment
13 | // specified by id.
14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
15 | if runtime.GOARCH == "arm" ||
16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" {
17 | cmd |= ipc_64
18 | }
19 |
20 | return shmctl(id, cmd, desc)
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin && !ios
6 | // +build darwin,!ios
7 |
8 | package unix
9 |
10 | // SysvShmCtl performs control operations on the shared memory segment
11 | // specified by id.
12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) {
13 | return shmctl(id, cmd, desc)
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/unveil_openbsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package unix
6 |
7 | import (
8 | "syscall"
9 | "unsafe"
10 | )
11 |
12 | // Unveil implements the unveil syscall.
13 | // For more information see unveil(2).
14 | // Note that the special case of blocking further
15 | // unveil calls is handled by UnveilBlock.
16 | func Unveil(path string, flags string) error {
17 | pathPtr, err := syscall.BytePtrFromString(path)
18 | if err != nil {
19 | return err
20 | }
21 | flagsPtr, err := syscall.BytePtrFromString(flags)
22 | if err != nil {
23 | return err
24 | }
25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0)
26 | if e != 0 {
27 | return e
28 | }
29 | return nil
30 | }
31 |
32 | // UnveilBlock blocks future unveil calls.
33 | // For more information see unveil(2).
34 | func UnveilBlock() error {
35 | // Both pointers must be nil.
36 | var pathUnsafe, flagsUnsafe unsafe.Pointer
37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0)
38 | if e != 0 {
39 | return e
40 | }
41 | return nil
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT.
2 |
3 | //go:build linux && (arm || arm64)
4 | // +build linux
5 | // +build arm arm64
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // PtraceRegsArm is the registers used by arm binaries.
12 | type PtraceRegsArm struct {
13 | Uregs [18]uint32
14 | }
15 |
16 | // PtraceGetRegsArm fetches the registers used by arm binaries.
17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
19 | }
20 |
21 | // PtraceSetRegsArm sets the registers used by arm binaries.
22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
24 | }
25 |
26 | // PtraceRegsArm64 is the registers used by arm64 binaries.
27 | type PtraceRegsArm64 struct {
28 | Regs [31]uint64
29 | Sp uint64
30 | Pc uint64
31 | Pstate uint64
32 | }
33 |
34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
37 | }
38 |
39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries.
40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT.
2 |
3 | package unix
4 |
5 | import "unsafe"
6 |
7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries.
8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error {
9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))}
10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
11 | }
12 |
13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries.
14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error {
15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))}
16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec)))
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT.
2 |
3 | //go:build linux && (mips || mips64)
4 | // +build linux
5 | // +build mips mips64
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // PtraceRegsMips is the registers used by mips binaries.
12 | type PtraceRegsMips struct {
13 | Regs [32]uint64
14 | Lo uint64
15 | Hi uint64
16 | Epc uint64
17 | Badvaddr uint64
18 | Status uint64
19 | Cause uint64
20 | }
21 |
22 | // PtraceGetRegsMips fetches the registers used by mips binaries.
23 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
25 | }
26 |
27 | // PtraceSetRegsMips sets the registers used by mips binaries.
28 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
30 | }
31 |
32 | // PtraceRegsMips64 is the registers used by mips64 binaries.
33 | type PtraceRegsMips64 struct {
34 | Regs [32]uint64
35 | Lo uint64
36 | Hi uint64
37 | Epc uint64
38 | Badvaddr uint64
39 | Status uint64
40 | Cause uint64
41 | }
42 |
43 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
44 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
46 | }
47 |
48 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries.
49 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go:
--------------------------------------------------------------------------------
1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT.
2 |
3 | //go:build linux && (mipsle || mips64le)
4 | // +build linux
5 | // +build mipsle mips64le
6 |
7 | package unix
8 |
9 | import "unsafe"
10 |
11 | // PtraceRegsMipsle is the registers used by mipsle binaries.
12 | type PtraceRegsMipsle struct {
13 | Regs [32]uint64
14 | Lo uint64
15 | Hi uint64
16 | Epc uint64
17 | Badvaddr uint64
18 | Status uint64
19 | Cause uint64
20 | }
21 |
22 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries.
23 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error {
24 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
25 | }
26 |
27 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries.
28 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error {
29 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
30 | }
31 |
32 | // PtraceRegsMips64le is the registers used by mips64le binaries.
33 | type PtraceRegsMips64le struct {
34 | Regs [32]uint64
35 | Lo uint64
36 | Hi uint64
37 | Epc uint64
38 | Badvaddr uint64
39 | Status uint64
40 | Cause uint64
41 | }
42 |
43 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries.
44 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error {
45 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
46 | }
47 |
48 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries.
49 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error {
50 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
51 | }
52 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | //go:build darwin && amd64 && go1.13
5 | // +build darwin,amd64,go1.13
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | var _ syscall.Errno
15 |
16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
17 |
18 | func closedir(dir uintptr) (err error) {
19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0)
20 | if e1 != 0 {
21 | err = errnoErr(e1)
22 | }
23 | return
24 | }
25 |
26 | var libc_closedir_trampoline_addr uintptr
27 |
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | var libc_readdir_r_trampoline_addr uintptr
39 |
40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go amd64
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | //go:build go1.13
5 | // +build go1.13
6 |
7 | #include "textflag.h"
8 |
9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0
10 | JMP libc_fdopendir(SB)
11 |
12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8
13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB)
14 |
15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0
16 | JMP libc_closedir(SB)
17 |
18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8
19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB)
20 |
21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0
22 | JMP libc_readdir_r(SB)
23 |
24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8
25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB)
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go:
--------------------------------------------------------------------------------
1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | //go:build darwin && arm64 && go1.13
5 | // +build darwin,arm64,go1.13
6 |
7 | package unix
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | var _ syscall.Errno
15 |
16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
17 |
18 | func closedir(dir uintptr) (err error) {
19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0)
20 | if e1 != 0 {
21 | err = errnoErr(e1)
22 | }
23 | return
24 | }
25 |
26 | var libc_closedir_trampoline_addr uintptr
27 |
28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib"
29 |
30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
31 |
32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) {
33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
34 | res = Errno(r0)
35 | return
36 | }
37 |
38 | var libc_readdir_r_trampoline_addr uintptr
39 |
40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib"
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s:
--------------------------------------------------------------------------------
1 | // go run mkasm_darwin.go arm64
2 | // Code generated by the command above; DO NOT EDIT.
3 |
4 | //go:build go1.13
5 | // +build go1.13
6 |
7 | #include "textflag.h"
8 |
9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0
10 | JMP libc_fdopendir(SB)
11 |
12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8
13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB)
14 |
15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0
16 | JMP libc_closedir(SB)
17 |
18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8
19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB)
20 |
21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0
22 | JMP libc_readdir_r(SB)
23 |
24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8
25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB)
26 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go:
--------------------------------------------------------------------------------
1 | // cgo -godefs types_illumos.go | go run mkpost.go
2 | // Code generated by the command above; see README.md. DO NOT EDIT.
3 |
4 | //go:build amd64 && illumos
5 | // +build amd64,illumos
6 |
7 | package unix
8 |
9 | const (
10 | TUNNEWPPA = 0x540001
11 | TUNSETPPA = 0x540002
12 |
13 | I_STR = 0x5308
14 | I_POP = 0x5303
15 | I_PUSH = 0x5302
16 | I_LINK = 0x530c
17 | I_UNLINK = 0x530d
18 | I_PLINK = 0x5316
19 | I_PUNLINK = 0x5317
20 |
21 | IF_UNITSEL = -0x7ffb8cca
22 | )
23 |
24 | type strbuf struct {
25 | Maxlen int32
26 | Len int32
27 | Buf *int8
28 | }
29 |
30 | type Strioctl struct {
31 | Cmd int32
32 | Timout int32
33 | Len int32
34 | Dp *int8
35 | }
36 |
37 | type Lifreq struct {
38 | Name [32]int8
39 | Lifru1 [4]byte
40 | Type uint32
41 | Lifru [336]byte
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/aliases.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows && go1.9
6 | // +build windows,go1.9
7 |
8 | package windows
9 |
10 | import "syscall"
11 |
12 | type Errno = syscall.Errno
13 | type SysProcAttr = syscall.SysProcAttr
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/empty.s:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build !go1.12
6 | // +build !go1.12
7 |
8 | // This file is here to allow bodyless functions with go:linkname for Go 1.11
9 | // and earlier (see https://golang.org/issue/23311).
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/env_windows.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | // Windows environment variables.
6 |
7 | package windows
8 |
9 | import (
10 | "syscall"
11 | "unsafe"
12 | )
13 |
14 | func Getenv(key string) (value string, found bool) {
15 | return syscall.Getenv(key)
16 | }
17 |
18 | func Setenv(key, value string) error {
19 | return syscall.Setenv(key, value)
20 | }
21 |
22 | func Clearenv() {
23 | syscall.Clearenv()
24 | }
25 |
26 | func Environ() []string {
27 | return syscall.Environ()
28 | }
29 |
30 | // Returns a default environment associated with the token, rather than the current
31 | // process. If inheritExisting is true, then this environment also inherits the
32 | // environment of the current process.
33 | func (token Token) Environ(inheritExisting bool) (env []string, err error) {
34 | var block *uint16
35 | err = CreateEnvironmentBlock(&block, token, inheritExisting)
36 | if err != nil {
37 | return nil, err
38 | }
39 | defer DestroyEnvironmentBlock(block)
40 | blockp := uintptr(unsafe.Pointer(block))
41 | for {
42 | entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp)))
43 | if len(entry) == 0 {
44 | break
45 | }
46 | env = append(env, entry)
47 | blockp += 2 * (uintptr(len(entry)) + 1)
48 | }
49 | return env, nil
50 | }
51 |
52 | func Unsetenv(key string) error {
53 | return syscall.Unsetenv(key)
54 | }
55 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/eventlog.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows
6 | // +build windows
7 |
8 | package windows
9 |
10 | const (
11 | EVENTLOG_SUCCESS = 0
12 | EVENTLOG_ERROR_TYPE = 1
13 | EVENTLOG_WARNING_TYPE = 2
14 | EVENTLOG_INFORMATION_TYPE = 4
15 | EVENTLOG_AUDIT_SUCCESS = 8
16 | EVENTLOG_AUDIT_FAILURE = 16
17 | )
18 |
19 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW
20 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource
21 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW
22 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/memory_windows.go:
--------------------------------------------------------------------------------
1 | // Copyright 2017 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package windows
6 |
7 | const (
8 | MEM_COMMIT = 0x00001000
9 | MEM_RESERVE = 0x00002000
10 | MEM_DECOMMIT = 0x00004000
11 | MEM_RELEASE = 0x00008000
12 | MEM_RESET = 0x00080000
13 | MEM_TOP_DOWN = 0x00100000
14 | MEM_WRITE_WATCH = 0x00200000
15 | MEM_PHYSICAL = 0x00400000
16 | MEM_RESET_UNDO = 0x01000000
17 | MEM_LARGE_PAGES = 0x20000000
18 |
19 | PAGE_NOACCESS = 0x00000001
20 | PAGE_READONLY = 0x00000002
21 | PAGE_READWRITE = 0x00000004
22 | PAGE_WRITECOPY = 0x00000008
23 | PAGE_EXECUTE = 0x00000010
24 | PAGE_EXECUTE_READ = 0x00000020
25 | PAGE_EXECUTE_READWRITE = 0x00000040
26 | PAGE_EXECUTE_WRITECOPY = 0x00000080
27 | PAGE_GUARD = 0x00000100
28 | PAGE_NOCACHE = 0x00000200
29 | PAGE_WRITECOMBINE = 0x00000400
30 | PAGE_TARGETS_INVALID = 0x40000000
31 | PAGE_TARGETS_NO_UPDATE = 0x40000000
32 |
33 | QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002
34 | QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001
35 | QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008
36 | QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004
37 | )
38 |
39 | type MemoryBasicInformation struct {
40 | BaseAddress uintptr
41 | AllocationBase uintptr
42 | AllocationProtect uint32
43 | PartitionId uint16
44 | RegionSize uintptr
45 | State uint32
46 | Protect uint32
47 | Type uint32
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/mkknownfolderids.bash:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Copyright 2019 The Go Authors. All rights reserved.
4 | # Use of this source code is governed by a BSD-style
5 | # license that can be found in the LICENSE file.
6 |
7 | set -e
8 | shopt -s nullglob
9 |
10 | knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)"
11 | [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; }
12 |
13 | {
14 | echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT."
15 | echo
16 | echo "package windows"
17 | echo "type KNOWNFOLDERID GUID"
18 | echo "var ("
19 | while read -r line; do
20 | [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue
21 | printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \
22 | "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \
23 | $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \
24 | $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" ))
25 | done < "$knownfolders"
26 | echo ")"
27 | } | gofmt > "zknownfolderids_windows.go"
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/mksyscall.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build generate
6 | // +build generate
7 |
8 | package windows
9 |
10 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go
11 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/race.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows && race
6 | // +build windows,race
7 |
8 | package windows
9 |
10 | import (
11 | "runtime"
12 | "unsafe"
13 | )
14 |
15 | const raceenabled = true
16 |
17 | func raceAcquire(addr unsafe.Pointer) {
18 | runtime.RaceAcquire(addr)
19 | }
20 |
21 | func raceReleaseMerge(addr unsafe.Pointer) {
22 | runtime.RaceReleaseMerge(addr)
23 | }
24 |
25 | func raceReadRange(addr unsafe.Pointer, len int) {
26 | runtime.RaceReadRange(addr, len)
27 | }
28 |
29 | func raceWriteRange(addr unsafe.Pointer, len int) {
30 | runtime.RaceWriteRange(addr, len)
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/race0.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows && !race
6 | // +build windows,!race
7 |
8 | package windows
9 |
10 | import (
11 | "unsafe"
12 | )
13 |
14 | const raceenabled = false
15 |
16 | func raceAcquire(addr unsafe.Pointer) {
17 | }
18 |
19 | func raceReleaseMerge(addr unsafe.Pointer) {
20 | }
21 |
22 | func raceReadRange(addr unsafe.Pointer, len int) {
23 | }
24 |
25 | func raceWriteRange(addr unsafe.Pointer, len int) {
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/str.go:
--------------------------------------------------------------------------------
1 | // Copyright 2009 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build windows
6 | // +build windows
7 |
8 | package windows
9 |
10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency
11 | if val < 0 {
12 | return "-" + itoa(-val)
13 | }
14 | var buf [32]byte // big enough for int64
15 | i := len(buf) - 1
16 | for val >= 10 {
17 | buf[i] = byte(val%10 + '0')
18 | i--
19 | val /= 10
20 | }
21 | buf[i] = byte(val + '0')
22 | return string(buf[i:])
23 | }
24 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/types_windows_386.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package windows
6 |
7 | type WSAData struct {
8 | Version uint16
9 | HighVersion uint16
10 | Description [WSADESCRIPTION_LEN + 1]byte
11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte
12 | MaxSockets uint16
13 | MaxUdpDg uint16
14 | VendorInfo *byte
15 | }
16 |
17 | type Servent struct {
18 | Name *byte
19 | Aliases **byte
20 | Port uint16
21 | Proto *byte
22 | }
23 |
24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
25 | PerProcessUserTimeLimit int64
26 | PerJobUserTimeLimit int64
27 | LimitFlags uint32
28 | MinimumWorkingSetSize uintptr
29 | MaximumWorkingSetSize uintptr
30 | ActiveProcessLimit uint32
31 | Affinity uintptr
32 | PriorityClass uint32
33 | SchedulingClass uint32
34 | _ uint32 // pad to 8 byte boundary
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/types_windows_amd64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package windows
6 |
7 | type WSAData struct {
8 | Version uint16
9 | HighVersion uint16
10 | MaxSockets uint16
11 | MaxUdpDg uint16
12 | VendorInfo *byte
13 | Description [WSADESCRIPTION_LEN + 1]byte
14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte
15 | }
16 |
17 | type Servent struct {
18 | Name *byte
19 | Aliases **byte
20 | Proto *byte
21 | Port uint16
22 | }
23 |
24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
25 | PerProcessUserTimeLimit int64
26 | PerJobUserTimeLimit int64
27 | LimitFlags uint32
28 | MinimumWorkingSetSize uintptr
29 | MaximumWorkingSetSize uintptr
30 | ActiveProcessLimit uint32
31 | Affinity uintptr
32 | PriorityClass uint32
33 | SchedulingClass uint32
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/types_windows_arm.go:
--------------------------------------------------------------------------------
1 | // Copyright 2018 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package windows
6 |
7 | type WSAData struct {
8 | Version uint16
9 | HighVersion uint16
10 | Description [WSADESCRIPTION_LEN + 1]byte
11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte
12 | MaxSockets uint16
13 | MaxUdpDg uint16
14 | VendorInfo *byte
15 | }
16 |
17 | type Servent struct {
18 | Name *byte
19 | Aliases **byte
20 | Port uint16
21 | Proto *byte
22 | }
23 |
24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
25 | PerProcessUserTimeLimit int64
26 | PerJobUserTimeLimit int64
27 | LimitFlags uint32
28 | MinimumWorkingSetSize uintptr
29 | MaximumWorkingSetSize uintptr
30 | ActiveProcessLimit uint32
31 | Affinity uintptr
32 | PriorityClass uint32
33 | SchedulingClass uint32
34 | _ uint32 // pad to 8 byte boundary
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/sys/windows/types_windows_arm64.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package windows
6 |
7 | type WSAData struct {
8 | Version uint16
9 | HighVersion uint16
10 | MaxSockets uint16
11 | MaxUdpDg uint16
12 | VendorInfo *byte
13 | Description [WSADESCRIPTION_LEN + 1]byte
14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte
15 | }
16 |
17 | type Servent struct {
18 | Name *byte
19 | Aliases **byte
20 | Proto *byte
21 | Port uint16
22 | }
23 |
24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct {
25 | PerProcessUserTimeLimit int64
26 | PerJobUserTimeLimit int64
27 | LimitFlags uint32
28 | MinimumWorkingSetSize uintptr
29 | MaximumWorkingSetSize uintptr
30 | ActiveProcessLimit uint32
31 | Affinity uintptr
32 | PriorityClass uint32
33 | SchedulingClass uint32
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/AUTHORS:
--------------------------------------------------------------------------------
1 | # This source code refers to The Go Authors for copyright purposes.
2 | # The master list of authors is in the main Go distribution,
3 | # visible at http://tip.golang.org/AUTHORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Go
2 |
3 | Go is an open source project.
4 |
5 | It is the work of hundreds of contributors. We appreciate your help!
6 |
7 | ## Filing issues
8 |
9 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions:
10 |
11 | 1. What version of Go are you using (`go version`)?
12 | 2. What operating system and processor architecture are you using?
13 | 3. What did you do?
14 | 4. What did you expect to see?
15 | 5. What did you see instead?
16 |
17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker.
18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug.
19 |
20 | ## Contributing code
21 |
22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html)
23 | before sending patches.
24 |
25 | Unless otherwise noted, the Go source files are distributed under
26 | the BSD-style license found in the LICENSE file.
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # This source code was written by the Go contributors.
2 | # The master list of contributors is in the main Go distribution,
3 | # visible at http://tip.golang.org/CONTRIBUTORS.
4 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/PATENTS:
--------------------------------------------------------------------------------
1 | Additional IP Rights Grant (Patents)
2 |
3 | "This implementation" means the copyrightable works distributed by
4 | Google as part of the Go project.
5 |
6 | Google hereby grants to You a perpetual, worldwide, non-exclusive,
7 | no-charge, royalty-free, irrevocable (except as stated in this section)
8 | patent license to make, have made, use, offer to sell, sell, import,
9 | transfer and otherwise run, modify and propagate the contents of this
10 | implementation of Go, where such license applies only to those patent
11 | claims, both currently owned or controlled by Google and acquired in
12 | the future, licensable by Google that are necessarily infringed by this
13 | implementation of Go. This grant does not include claims that would be
14 | infringed only as a consequence of further modification of this
15 | implementation. If you or your agent or exclusive licensee institute or
16 | order or agree to the institution of patent litigation against any
17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging
18 | that this implementation of Go or any code incorporated within this
19 | implementation of Go constitutes direct or contributory patent
20 | infringement, or inducement of patent infringement, then any patent
21 | rights granted to you under this License for this implementation of Go
22 | shall terminate as of the date such litigation is filed.
23 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/README.md:
--------------------------------------------------------------------------------
1 | # Go terminal/console support
2 |
3 | [](https://pkg.go.dev/golang.org/x/term)
4 |
5 | This repository provides Go terminal and console support packages.
6 |
7 | ## Download/Install
8 |
9 | The easiest way to install is to run `go get -u golang.org/x/term`. You can
10 | also manually git clone the repository to `$GOPATH/src/golang.org/x/term`.
11 |
12 | ## Report Issues / Send Patches
13 |
14 | This repository uses Gerrit for code changes. To learn how to submit changes to
15 | this repository, see https://golang.org/doc/contribute.html.
16 |
17 | The main issue tracker for the term repository is located at
18 | https://github.com/golang/go/issues. Prefix your issue with "x/term:" in the
19 | subject line, so it is easy to find.
20 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/codereview.cfg:
--------------------------------------------------------------------------------
1 | issuerepo: golang/go
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/term_plan9.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | package term
6 |
7 | import (
8 | "fmt"
9 | "runtime"
10 |
11 | "golang.org/x/sys/plan9"
12 | )
13 |
14 | type state struct{}
15 |
16 | func isTerminal(fd int) bool {
17 | path, err := plan9.Fd2path(fd)
18 | if err != nil {
19 | return false
20 | }
21 | return path == "/dev/cons" || path == "/mnt/term/dev/cons"
22 | }
23 |
24 | func makeRaw(fd int) (*State, error) {
25 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
26 | }
27 |
28 | func getState(fd int) (*State, error) {
29 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
30 | }
31 |
32 | func restore(fd int, state *State) error {
33 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
34 | }
35 |
36 | func getSize(fd int) (width, height int, err error) {
37 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
38 | }
39 |
40 | func readPassword(fd int) ([]byte, error) {
41 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
42 | }
43 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/term_unix_bsd.go:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd
6 | // +build darwin dragonfly freebsd netbsd openbsd
7 |
8 | package term
9 |
10 | import "golang.org/x/sys/unix"
11 |
12 | const ioctlReadTermios = unix.TIOCGETA
13 | const ioctlWriteTermios = unix.TIOCSETA
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/term_unix_other.go:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build aix || linux || solaris || zos
6 | // +build aix linux solaris zos
7 |
8 | package term
9 |
10 | import "golang.org/x/sys/unix"
11 |
12 | const ioctlReadTermios = unix.TCGETS
13 | const ioctlWriteTermios = unix.TCSETS
14 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/term/term_unsupported.go:
--------------------------------------------------------------------------------
1 | // Copyright 2019 The Go Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style
3 | // license that can be found in the LICENSE file.
4 |
5 | //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !zos && !windows && !solaris && !plan9
6 | // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!zos,!windows,!solaris,!plan9
7 |
8 | package term
9 |
10 | import (
11 | "fmt"
12 | "runtime"
13 | )
14 |
15 | type state struct{}
16 |
17 | func isTerminal(fd int) bool {
18 | return false
19 | }
20 |
21 | func makeRaw(fd int) (*State, error) {
22 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
23 | }
24 |
25 | func getState(fd int) (*State, error) {
26 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
27 | }
28 |
29 | func restore(fd int, state *State) error {
30 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
31 | }
32 |
33 | func getSize(fd int) (width, height int, err error) {
34 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
35 | }
36 |
37 | func readPassword(fd int) ([]byte, error) {
38 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/modules.txt:
--------------------------------------------------------------------------------
1 | # github.com/creack/pty v1.1.18
2 | ## explicit; go 1.13
3 | github.com/creack/pty
4 | # github.com/google/uuid v1.3.0
5 | ## explicit
6 | github.com/google/uuid
7 | # github.com/hashicorp/go-version v1.5.0
8 | ## explicit
9 | github.com/hashicorp/go-version
10 | # github.com/inconshreveable/mousetrap v1.0.0
11 | ## explicit
12 | github.com/inconshreveable/mousetrap
13 | # github.com/liamg/tml v0.6.0
14 | ## explicit; go 1.12
15 | github.com/liamg/tml
16 | # github.com/spf13/cobra v1.5.0
17 | ## explicit; go 1.15
18 | github.com/spf13/cobra
19 | # github.com/spf13/pflag v1.0.5
20 | ## explicit; go 1.12
21 | github.com/spf13/pflag
22 | # golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
23 | ## explicit; go 1.17
24 | golang.org/x/crypto/ssh/terminal
25 | # golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c
26 | ## explicit; go 1.17
27 | golang.org/x/sys/internal/unsafeheader
28 | golang.org/x/sys/plan9
29 | golang.org/x/sys/unix
30 | golang.org/x/sys/windows
31 | # golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
32 | ## explicit; go 1.17
33 | golang.org/x/term
34 |
--------------------------------------------------------------------------------