├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── download.go ├── gendesk.1 ├── gendeskrc.example ├── go.mod ├── go.sum ├── guesscategory.go ├── main.go ├── pkgbuildparser.go ├── release.sh ├── testdata └── PKGBUILD ├── utils.go ├── utils_test.go ├── vendor ├── github.com │ ├── mattn │ │ ├── go-colorable │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── colorable_others.go │ │ │ ├── colorable_windows.go │ │ │ ├── go.test.sh │ │ │ └── noncolorable.go │ │ └── go-isatty │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.test.sh │ │ │ ├── isatty_bsd.go │ │ │ ├── isatty_others.go │ │ │ ├── isatty_plan9.go │ │ │ ├── isatty_solaris.go │ │ │ ├── isatty_tcgets.go │ │ │ └── isatty_windows.go │ ├── mgutz │ │ └── ansi │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── ansi.go │ │ │ ├── doc.go │ │ │ └── print.go │ ├── nathan-fiscaletti │ │ └── consolesize-go │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── consolesize_unix.go │ │ │ └── consolesize_windows.go │ ├── pkg │ │ └── term │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── term.go │ │ │ ├── term_bsdi.go │ │ │ ├── term_bsdu.go │ │ │ ├── term_darwin.go │ │ │ ├── term_linux.go │ │ │ ├── term_open_posix.go │ │ │ ├── term_posix.go │ │ │ ├── term_solaris.go │ │ │ ├── term_windows.go │ │ │ └── termios │ │ │ ├── doc.go │ │ │ ├── ioctl.go │ │ │ ├── pty.go │ │ │ ├── pty_cgo.go │ │ │ ├── pty_darwin.go │ │ │ ├── pty_freebsd.go │ │ │ ├── pty_linux.go │ │ │ ├── pty_netbsd.go │ │ │ ├── termios.go │ │ │ ├── termios_bsd.go │ │ │ ├── termios_const.go │ │ │ ├── termios_const_solaris.go │ │ │ ├── termios_linux.go │ │ │ └── termios_solaris.go │ ├── unknwon │ │ └── goconfig │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── README_ZH.md │ │ │ ├── conf.go │ │ │ ├── read.go │ │ │ ├── util.go │ │ │ └── write.go │ ├── xyproto │ │ ├── burnfont │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── burnfont.go │ │ │ └── render.go │ │ ├── env │ │ │ └── v2 │ │ │ │ ├── LICENSE │ │ │ │ ├── cache.go │ │ │ │ ├── env.go │ │ │ │ ├── etc.go │ │ │ │ ├── homedir.go │ │ │ │ ├── homedir_android.go │ │ │ │ ├── homedir_ios.go │ │ │ │ ├── homedir_plan9.go │ │ │ │ ├── homedir_windows.go │ │ │ │ └── session.go │ │ ├── textoutput │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── colormap_win.go │ │ │ ├── textoutput.go │ │ │ └── textoutput_win.go │ │ └── vt100 │ │ │ ├── .gitignore │ │ │ ├── .ignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── TODO.md │ │ │ ├── canvas.go │ │ │ ├── colors.go │ │ │ ├── key.go │ │ │ ├── size.go │ │ │ ├── size_windows.go │ │ │ ├── toimage.go │ │ │ ├── utils.go │ │ │ ├── vt100.go │ │ │ └── words.go │ └── yhat │ │ └── scrape │ │ ├── LICENSE │ │ ├── README.md │ │ └── scrape.go ├── golang.org │ └── x │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── html │ │ │ ├── atom │ │ │ ├── atom.go │ │ │ └── table.go │ │ │ ├── const.go │ │ │ ├── doc.go │ │ │ ├── doctype.go │ │ │ ├── entity.go │ │ │ ├── escape.go │ │ │ ├── foreign.go │ │ │ ├── iter.go │ │ │ ├── node.go │ │ │ ├── parse.go │ │ │ ├── render.go │ │ │ └── token.go │ │ └── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── 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_bsd_ppc64.s │ │ ├── asm_bsd_riscv64.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 │ │ ├── auxv.go │ │ ├── auxv_unsupported.go │ │ ├── bluetooth_linux.go │ │ ├── bpxsvc_zos.go │ │ ├── bpxsvc_zos.s │ │ ├── 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 │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_signed.go │ │ ├── ioctl_unsigned.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mmap_nomremap.go │ │ ├── mremap.go │ │ ├── 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 │ │ ├── sockcmsg_zos.go │ │ ├── symaddr_zos_s390x.s │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.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_freebsd_riscv64.go │ │ ├── syscall_hurd.go │ │ ├── syscall_hurd_386.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_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_riscv64.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 │ │ ├── vgetrandom_linux.go │ │ ├── vgetrandom_unsupported.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_freebsd_riscv64.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_openbsd_ppc64.go │ │ ├── zerrors_openbsd_riscv64.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 │ │ ├── zsymaddr_zos_s390x.s │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.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_freebsd_riscv64.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_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm.s │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_openbsd_mips64.s │ │ ├── zsyscall_openbsd_ppc64.go │ │ ├── zsyscall_openbsd_ppc64.s │ │ ├── zsyscall_openbsd_riscv64.go │ │ ├── zsyscall_openbsd_riscv64.s │ │ ├── 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 │ │ ├── zsysctl_openbsd_ppc64.go │ │ ├── zsysctl_openbsd_riscv64.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_freebsd_riscv64.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_openbsd_ppc64.go │ │ ├── zsysnum_openbsd_riscv64.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_freebsd_riscv64.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_openbsd_ppc64.go │ │ ├── ztypes_openbsd_riscv64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ │ └── windows │ │ ├── aliases.go │ │ ├── dll_windows.go │ │ ├── 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 └── modules.txt └── version.sh /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | name: Build 3 | jobs: 4 | test: 5 | strategy: 6 | matrix: 7 | go-version: [1.21.x, 1.22.x, 1.23.x, 1.24.x] 8 | os: [ubuntu-latest, macos-latest] 9 | runs-on: ${{ matrix.os }} 10 | steps: 11 | - name: Install Go 12 | uses: actions/setup-go@v5 13 | with: 14 | go-version: ${{ matrix.go-version }} 15 | - name: Checkout code 16 | uses: actions/checkout@v4 17 | - name: Test 18 | run: go test ./... 19 | 20 | test-cache: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Install Go 24 | uses: actions/setup-go@v5 25 | with: 26 | go-version: 1.22.x 27 | - name: Checkout code 28 | uses: actions/checkout@v4 29 | - uses: actions/cache@v4 30 | with: 31 | path: | 32 | ~/go/pkg/mod # Module download cache 33 | ~/.cache/go-build # Build cache (Linux) 34 | ~/Library/Caches/go-build # Build cache (Mac) 35 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 36 | restore-keys: | 37 | ${{ runner.os }}-go- 38 | - name: Test 39 | run: go test ./... 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | gendesk 2 | *.desktop 3 | *.png 4 | ChangeLog.md 5 | dist/ 6 | 7 | # Generated from README.md 8 | CHANGELOG.md 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Alexander F. Rødseth 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /gendeskrc.example: -------------------------------------------------------------------------------- 1 | [default] 2 | # URL for searching for icons by replacing %s with the package name 3 | icon_url = http://openiconlibrary.sourceforge.net/gallery2/open_icon_library-full/icons/png/48x48/apps/%s.png 4 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module gendesk 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.24.0 6 | 7 | require ( 8 | github.com/unknwon/goconfig v1.0.0 9 | github.com/xyproto/env/v2 v2.5.3 10 | github.com/xyproto/textoutput v1.17.2 11 | github.com/yhat/scrape v0.0.0-20161128144610-24b7890b0945 12 | golang.org/x/net v0.40.0 13 | ) 14 | 15 | require ( 16 | github.com/mattn/go-colorable v0.1.14 // indirect 17 | github.com/mattn/go-isatty v0.0.20 // indirect 18 | github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect 19 | github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d // indirect 20 | github.com/pkg/term v1.2.0-beta.2.0.20210419004637-f749b98bd0ba // indirect 21 | github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect 22 | github.com/xyproto/burnfont v1.2.3 // indirect 23 | github.com/xyproto/vt100 v1.16.12 // indirect 24 | golang.org/x/sys v0.33.0 // indirect 25 | ) 26 | -------------------------------------------------------------------------------- /testdata/PKGBUILD: -------------------------------------------------------------------------------- 1 | _name=zoo 2 | pkgname="${_name}-bin" 3 | _exec="${_name}" 4 | pkgver=5.5.4 5 | _build=7938.0228 6 | pkgrel=1 7 | pkgdesc='Video conferencing for Zoo animals' 8 | arch=('x86_64') 9 | license=('custom') 10 | url="https://zoo.us/" 11 | depends=('fontconfig' 'glib2' 'libpulse' 'libsm' 'ttf-font' 'libx11' 'libxcb' 'libxcomposite' 'libxfixes' 'libxi' 'libxcursor' 12 | 'libxkbcommon-x11' 'libxrandr' 'libxrender' 'libxshmfence' 'libxslt' 'mesa' 'nss' 'xcb-util-image' 'xcb-util-keysyms') 13 | optdepends=('pulseaudio-alsa: audio via PulseAudio' 14 | 'qt5-webengine: SSO login support' 15 | 'picom: extra compositor needed by some window managers for screen sharing' 16 | 'xcompmgr: extra compositor needed by some window managers for screen sharing') 17 | options=(!strip) 18 | source=("${pkgname}-${pkgver}_orig_x86_64.pkg.tar.xz"::"https://zoo.us/client/${pkgver:0:-1}${_build}/zoo_x86_64.pkg.tar.xz") 19 | sha512sums=('46c045bd03319fc200dd70e218d84ba94fb3e317e94986198f7c55f8e11ea8be12fbcbec4d1dab1861dca1dec78bd5d14f1ef6fa9090877bf176f20481c1c4fd') 20 | 21 | prepare() { 22 | sed -i 's/Zoo\.png/Zoo/g' "${srcdir}/usr/share/applications/Zoo.desktop" 23 | sed -i 's/StartupWMClass=Zoo/StartupWMClass=zoo/g' "${srcdir}/usr/share/applications/Zoo.desktop" 24 | } 25 | 26 | package() { 27 | cp -dpr --no-preserve=ownership opt usr "${pkgdir}" 28 | } 29 | -------------------------------------------------------------------------------- /utils_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func Example_capitalize() { 9 | fmt.Println(capitalize("hello")) 10 | fmt.Println(capitalize("")) 11 | fmt.Println(capitalize("t")) 12 | // output: 13 | // Hello 14 | // 15 | // T 16 | } 17 | 18 | func Example_between() { 19 | fmt.Println(between("AB", "A", "B")) 20 | fmt.Println(between("co ow", "c", "w")) 21 | fmt.Println(between("", "", "")) 22 | fmt.Println(between(" ,\\__/,", ",", ",")) 23 | fmt.Println(between("AB", "B", "A")) 24 | fmt.Println(between("hhii", "h", "i")) 25 | // output: 26 | // 27 | // o o 28 | // 29 | // \__/ 30 | // 31 | // hi 32 | } 33 | 34 | func Example_betweenQuotes() { 35 | fmt.Println(betweenQuotes(`"hi"`)) 36 | fmt.Println(betweenQuotes(`asdf "hi" asdf`)) 37 | fmt.Println(betweenQuotes(`asdf ""hi"" asdf`)) 38 | fmt.Println(betweenQuotes(`asdf "'hi'" asdf`)) 39 | fmt.Println(betweenQuotes(`asdf '"hi asdf`)) 40 | fmt.Println(betweenQuotes(`asdf '"hi'" asdf`)) 41 | // output: 42 | // hi 43 | // hi 44 | // "hi" 45 | // 'hi' 46 | // 47 | // hi' 48 | } 49 | 50 | func Example_betweenQuotesOrAfterEquals() { 51 | fmt.Println(betweenQuotesOrAfterEquals("a = 123")) 52 | fmt.Println(betweenQuotesOrAfterEquals(`"asdf"`)) 53 | fmt.Println(betweenQuotesOrAfterEquals(`x = "z = fnufnu"`)) 54 | // output: 55 | // 123 56 | // asdf 57 | // z = fnufnu 58 | } 59 | 60 | func TestHas(t *testing.T) { 61 | if !has("a b c", "b") { 62 | t.Fail() 63 | } 64 | if !has("a b b c", "b") { 65 | t.Fail() 66 | } 67 | if has("", "a") { 68 | t.Fail() 69 | } 70 | if has(" ", "a") { 71 | t.Fail() 72 | } 73 | if has(" ", " ") { 74 | t.Fail() 75 | } 76 | if has(" ", " ") { 77 | t.Fail() 78 | } 79 | if !has(`"a"`, `"a"`) { 80 | t.Fail() 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 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 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | [![Build Status](https://github.com/mattn/go-colorable/workflows/test/badge.svg)](https://github.com/mattn/go-colorable/actions?query=workflow%3Atest) 4 | [![Codecov](https://codecov.io/gh/mattn/go-colorable/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-colorable) 5 | [![GoDoc](https://godoc.org/github.com/mattn/go-colorable?status.svg)](http://godoc.org/github.com/mattn/go-colorable) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-colorable)](https://goreportcard.com/report/mattn/go-colorable) 7 | 8 | Colorable writer for windows. 9 | 10 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 11 | This package is possible to handle escape sequence for ansi color on windows. 12 | 13 | ## Too Bad! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 16 | 17 | 18 | ## So Good! 19 | 20 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 21 | 22 | ## Usage 23 | 24 | ```go 25 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 26 | logrus.SetOutput(colorable.NewColorableStdout()) 27 | 28 | logrus.Info("succeeded") 29 | logrus.Warn("not correct") 30 | logrus.Error("something error") 31 | logrus.Fatal("panic") 32 | ``` 33 | 34 | You can compile above code on non-windows OSs. 35 | 36 | ## Installation 37 | 38 | ``` 39 | $ go get github.com/mattn/go-colorable 40 | ``` 41 | 42 | # License 43 | 44 | MIT 45 | 46 | # Author 47 | 48 | Yasuhiro Matsumoto (a.k.a mattn) 49 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows || appengine 2 | // +build !windows appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // NonColorable holds writer but removes escape sequence. 9 | type NonColorable struct { 10 | out io.Writer 11 | } 12 | 13 | // NewNonColorable returns new instance of Writer which removes escape sequence from Writer. 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | // Write writes data on console 19 | func (w *NonColorable) Write(data []byte) (n int, err error) { 20 | er := bytes.NewReader(data) 21 | var plaintext bytes.Buffer 22 | loop: 23 | for { 24 | c1, err := er.ReadByte() 25 | if err != nil { 26 | plaintext.WriteTo(w.out) 27 | break loop 28 | } 29 | if c1 != 0x1b { 30 | plaintext.WriteByte(c1) 31 | continue 32 | } 33 | _, err = plaintext.WriteTo(w.out) 34 | if err != nil { 35 | break loop 36 | } 37 | c2, err := er.ReadByte() 38 | if err != nil { 39 | break loop 40 | } 41 | if c2 != 0x5b { 42 | continue 43 | } 44 | 45 | for { 46 | c, err := er.ReadByte() 47 | if err != nil { 48 | break loop 49 | } 50 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 51 | break 52 | } 53 | } 54 | } 55 | 56 | return len(data), nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build (appengine || js || nacl || tinygo || wasm) && !windows 2 | // +build appengine js nacl tinygo wasm 3 | // +build !windows 4 | 5 | package isatty 6 | 7 | // IsTerminal returns true if the file descriptor is terminal which 8 | // is always false on js and appengine classic which is a sandboxed PaaS. 9 | func IsTerminal(fd uintptr) bool { 10 | return false 11 | } 12 | 13 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 14 | // terminal. This is also always false on this environment. 15 | func IsCygwinTerminal(fd uintptr) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine && !tinygo 2 | // +build linux aix zos 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mgutz/ansi/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | -------------------------------------------------------------------------------- /vendor/github.com/mgutz/ansi/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2013 Mario L. Gutierrez 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | 10 | -------------------------------------------------------------------------------- /vendor/github.com/mgutz/ansi/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package ansi is a small, fast library to create ANSI colored strings and codes. 3 | 4 | Installation 5 | 6 | # this installs the color viewer and the package 7 | go get -u github.com/mgutz/ansi/cmd/ansi-mgutz 8 | 9 | Example 10 | 11 | // colorize a string, SLOW 12 | msg := ansi.Color("foo", "red+b:white") 13 | 14 | // create a closure to avoid recalculating ANSI code compilation 15 | phosphorize := ansi.ColorFunc("green+h:black") 16 | msg = phosphorize("Bring back the 80s!") 17 | msg2 := phospohorize("Look, I'm a CRT!") 18 | 19 | // cache escape codes and build strings manually 20 | lime := ansi.ColorCode("green+h:black") 21 | reset := ansi.ColorCode("reset") 22 | 23 | fmt.Println(lime, "Bring back the 80s!", reset) 24 | 25 | Other examples 26 | 27 | Color(s, "red") // red 28 | Color(s, "red+b") // red bold 29 | Color(s, "red+B") // red blinking 30 | Color(s, "red+u") // red underline 31 | Color(s, "red+bh") // red bold bright 32 | Color(s, "red:white") // red on white 33 | Color(s, "red+b:white+h") // red bold on white bright 34 | Color(s, "red+B:white+h") // red blink on white bright 35 | 36 | To view color combinations, from terminal 37 | 38 | ansi-mgutz 39 | 40 | Style format 41 | 42 | "foregroundColor+attributes:backgroundColor+attributes" 43 | 44 | Colors 45 | 46 | black 47 | red 48 | green 49 | yellow 50 | blue 51 | magenta 52 | cyan 53 | white 54 | 55 | Attributes 56 | 57 | b = bold foreground 58 | B = Blink foreground 59 | u = underline foreground 60 | h = high intensity (bright) foreground, background 61 | d = dim foreground 62 | i = inverse 63 | 64 | Wikipedia ANSI escape codes [Colors](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 65 | */ 66 | package ansi 67 | -------------------------------------------------------------------------------- /vendor/github.com/mgutz/ansi/print.go: -------------------------------------------------------------------------------- 1 | package ansi 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | 7 | colorable "github.com/mattn/go-colorable" 8 | ) 9 | 10 | // PrintStyles prints all style combinations to the terminal. 11 | func PrintStyles() { 12 | // for compatibility with Windows, not needed for *nix 13 | stdout := colorable.NewColorableStdout() 14 | 15 | bgColors := []string{ 16 | "", 17 | ":black", 18 | ":red", 19 | ":green", 20 | ":yellow", 21 | ":blue", 22 | ":magenta", 23 | ":cyan", 24 | ":white", 25 | } 26 | 27 | keys := make([]string, 0, len(Colors)) 28 | for k := range Colors { 29 | keys = append(keys, k) 30 | } 31 | 32 | sort.Sort(sort.StringSlice(keys)) 33 | 34 | for _, fg := range keys { 35 | for _, bg := range bgColors { 36 | fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg})) 37 | fmt.Fprintln(stdout, padColor(fg, []string{"+s" + bg, "+i" + bg})) 38 | fmt.Fprintln(stdout, padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h"})) 39 | fmt.Fprintln(stdout, padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"})) 40 | } 41 | } 42 | } 43 | 44 | func pad(s string, length int) string { 45 | for len(s) < length { 46 | s += " " 47 | } 48 | return s 49 | } 50 | 51 | func padColor(color string, styles []string) string { 52 | buffer := "" 53 | for _, style := range styles { 54 | buffer += Color(pad(color+style, 20), color+style) 55 | } 56 | return buffer 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/nathan-fiscaletti/consolesize-go/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Nathan Fiscaletti 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 | -------------------------------------------------------------------------------- /vendor/github.com/nathan-fiscaletti/consolesize-go/README.md: -------------------------------------------------------------------------------- 1 | # consolesize-go 2 | 3 | [![Sponsor Me!](https://img.shields.io/badge/%F0%9F%92%B8-Sponsor%20Me!-blue)](https://github.com/sponsors/nathan-fiscaletti) 4 | [![GoDoc](https://godoc.org/github.com/nathan-fiscaletti/consolesize-go?status.svg)](https://godoc.org/github.com/nathan-fiscaletti/consolesize-go) 5 | [![Go Report Card](https://goreportcard.com/badge/github.com/nathan-fiscaletti/consolesize-go)](https://goreportcard.com/report/github.com/nathan-fiscaletti/consolesize-go) 6 | 7 | **consolesize-go** is a library that will allow you to read the size of any console window on both **Unix** and **Windows** systems. 8 | 9 | ## Install 10 | 11 | ```sh 12 | $ go get github.com/nathan-fiscaletti/consolesize-go 13 | ``` 14 | 15 | ## Usage 16 | 17 | ```go 18 | package main 19 | 20 | import ( 21 | "fmt" 22 | 23 | "github.com/nathan-fiscaletti/consolesize-go" 24 | ) 25 | 26 | func main() { 27 | cols, rows := consolesize.GetConsoleSize() 28 | fmt.Printf("Rows: %v, Cols: %v\n", rows, cols) 29 | } 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /vendor/github.com/nathan-fiscaletti/consolesize-go/consolesize_unix.go: -------------------------------------------------------------------------------- 1 | // +build unix, !windows 2 | 3 | package consolesize 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // GetConsoleSize returns the current number of columns and rows in the active console window. 11 | // The return value of this function is in the order of cols, rows. 12 | func GetConsoleSize() (int, int) { 13 | var sz struct { 14 | rows uint16 15 | cols uint16 16 | xpixels uint16 17 | ypixels uint16 18 | } 19 | _, _, _ = syscall.Syscall(syscall.SYS_IOCTL, 20 | uintptr(syscall.Stdout), uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(&sz))) 21 | return int(sz.cols), int(sz.rows) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/nathan-fiscaletti/consolesize-go/consolesize_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows, !unix 2 | 3 | package consolesize 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | type ( 12 | short int16 13 | word uint16 14 | smallRect struct { 15 | Left short 16 | Top short 17 | Right short 18 | Bottom short 19 | } 20 | coord struct { 21 | X short 22 | Y short 23 | } 24 | consoleScreenBufferInfo struct { 25 | Size coord 26 | CursorPosition coord 27 | Attributes word 28 | Window smallRect 29 | MaximumWindowSize coord 30 | } 31 | ) 32 | 33 | var kernel32DLL = syscall.NewLazyDLL("kernel32.dll") 34 | var getConsoleScreenBufferInfoProc = kernel32DLL.NewProc("GetConsoleScreenBufferInfo") 35 | 36 | // GetConsoleSize returns the current number of columns and rows in the active console window. 37 | // The return value of this function is in the order of cols, rows. 38 | func GetConsoleSize() (int, int) { 39 | stdoutHandle := getStdHandle(syscall.STD_OUTPUT_HANDLE) 40 | var info, err = getConsoleScreenBufferInfo(stdoutHandle) 41 | 42 | if err != nil { 43 | return 0, 0 44 | } 45 | 46 | return int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1) 47 | } 48 | 49 | func getError(r1, r2 uintptr, lastErr error) error { 50 | // If the function fails, the return value is zero. 51 | if r1 == 0 { 52 | if lastErr != nil { 53 | return lastErr 54 | } 55 | return syscall.EINVAL 56 | } 57 | return nil 58 | } 59 | 60 | func getStdHandle(stdhandle int) uintptr { 61 | handle, err := syscall.GetStdHandle(stdhandle) 62 | if err != nil { 63 | panic(fmt.Errorf("could not get standard io handle %d", stdhandle)) 64 | } 65 | return uintptr(handle) 66 | } 67 | 68 | func getConsoleScreenBufferInfo(handle uintptr) (*consoleScreenBufferInfo, error) { 69 | var info consoleScreenBufferInfo 70 | if err := getError(getConsoleScreenBufferInfoProc.Call(handle, uintptr(unsafe.Pointer(&info)), 0)); err != nil { 71 | return nil, err 72 | } 73 | return &info, nil 74 | } 75 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/term 3 | go: 4 | - 1.13.x 5 | - 1.14.x 6 | - tip 7 | 8 | script: 9 | - go test -v ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, David Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/term.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | // Package term manages POSIX terminals. As POSIX terminals are connected to, 4 | // or emulate, a UART, this package also provides control over the various 5 | // UART and serial line parameters. 6 | package term 7 | 8 | import ( 9 | "io" 10 | "os" 11 | 12 | "github.com/pkg/term/termios" 13 | "golang.org/x/sys/unix" 14 | ) 15 | 16 | const ( 17 | NONE = iota // flow control off 18 | XONXOFF // software flow control 19 | HARDWARE // hardware flow control 20 | ) 21 | 22 | // Read reads up to len(b) bytes from the terminal. It returns the number of 23 | // bytes read and an error, if any. EOF is signaled by a zero count with 24 | // err set to io.EOF. 25 | func (t *Term) Read(b []byte) (int, error) { 26 | n, e := unix.Read(t.fd, b) 27 | if n < 0 { 28 | n = 0 29 | } 30 | if n == 0 && len(b) > 0 && e == nil { 31 | return 0, io.EOF 32 | } 33 | if e != nil { 34 | return n, &os.PathError{ 35 | Op: "read", 36 | Path: t.name, 37 | Err: e} 38 | } 39 | return n, nil 40 | } 41 | 42 | // SetOption takes one or more option function and applies them in order to Term. 43 | func (t *Term) SetOption(options ...func(*Term) error) error { 44 | for _, opt := range options { 45 | if err := opt(t); err != nil { 46 | return err 47 | } 48 | } 49 | return nil 50 | } 51 | 52 | // Write writes len(b) bytes to the terminal. It returns the number of bytes 53 | // written and an error, if any. Write returns a non-nil error when n != 54 | // len(b). 55 | func (t *Term) Write(b []byte) (int, error) { 56 | n, e := unix.Write(t.fd, b) 57 | if n < 0 { 58 | n = 0 59 | } 60 | if n != len(b) { 61 | return n, io.ErrShortWrite 62 | } 63 | if e != nil { 64 | return n, &os.PathError{ 65 | Op: "write", 66 | Path: t.name, 67 | Err: e, 68 | } 69 | } 70 | return n, nil 71 | } 72 | 73 | // Available returns how many bytes are unused in the buffer. 74 | func (t *Term) Available() (int, error) { 75 | return termios.Tiocinq(uintptr(t.fd)) 76 | } 77 | 78 | // Buffered returns the number of bytes that have been written into the current buffer. 79 | func (t *Term) Buffered() (int, error) { 80 | return termios.Tiocoutq(uintptr(t.fd)) 81 | } 82 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/term_darwin.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import "golang.org/x/sys/unix" 4 | 5 | type attr unix.Termios 6 | 7 | func (a *attr) getSpeed() (int, error) { 8 | // We generally only care about ospeed, since that's what would 9 | // be used for padding characters, for example. 10 | 11 | switch a.Ospeed { 12 | case unix.B50: 13 | return 50, nil 14 | case unix.B75: 15 | return 75, nil 16 | case unix.B110: 17 | return 110, nil 18 | case unix.B134: 19 | return 134, nil 20 | case unix.B150: 21 | return 150, nil 22 | case unix.B200: 23 | return 200, nil 24 | case unix.B300: 25 | return 300, nil 26 | case unix.B600: 27 | return 600, nil 28 | case unix.B1200: 29 | return 1200, nil 30 | case unix.B1800: 31 | return 1800, nil 32 | case unix.B2400: 33 | return 2400, nil 34 | case unix.B4800: 35 | return 4800, nil 36 | case unix.B9600: 37 | return 9600, nil 38 | case unix.B19200: 39 | return 19200, nil 40 | case unix.B38400: 41 | return 38400, nil 42 | case unix.B57600: 43 | return 57600, nil 44 | case unix.B115200: 45 | return 115200, nil 46 | case unix.B230400: 47 | return 230400, nil 48 | default: 49 | return 0, unix.EINVAL 50 | } 51 | } 52 | 53 | func (a *attr) setSpeed(baud int) error { 54 | var rate uint64 55 | switch baud { 56 | case 50: 57 | rate = unix.B50 58 | case 75: 59 | rate = unix.B75 60 | case 110: 61 | rate = unix.B110 62 | case 134: 63 | rate = unix.B134 64 | case 150: 65 | rate = unix.B150 66 | case 200: 67 | rate = unix.B200 68 | case 300: 69 | rate = unix.B300 70 | case 600: 71 | rate = unix.B600 72 | case 1200: 73 | rate = unix.B1200 74 | case 1800: 75 | rate = unix.B1800 76 | case 2400: 77 | rate = unix.B2400 78 | case 4800: 79 | rate = unix.B4800 80 | case 9600: 81 | rate = unix.B9600 82 | case 19200: 83 | rate = unix.B19200 84 | case 38400: 85 | rate = unix.B38400 86 | case 57600: 87 | rate = unix.B57600 88 | case 115200: 89 | rate = unix.B115200 90 | case 230400: 91 | rate = unix.B230400 92 | default: 93 | return unix.EINVAL 94 | } 95 | (*unix.Termios)(a).Cflag = unix.CS8 | unix.CREAD | unix.CLOCAL | rate 96 | (*unix.Termios)(a).Ispeed = rate 97 | (*unix.Termios)(a).Ospeed = rate 98 | return nil 99 | } 100 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/term_open_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!solaris 2 | 3 | package term 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/pkg/term/termios" 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | // Open opens an asynchronous communications port. 13 | func Open(name string, options ...func(*Term) error) (*Term, error) { 14 | fd, e := unix.Open(name, unix.O_NOCTTY|unix.O_CLOEXEC|unix.O_NDELAY|unix.O_RDWR, 0666) 15 | if e != nil { 16 | return nil, &os.PathError{ 17 | Op: "open", 18 | Path: name, 19 | Err: e, 20 | } 21 | } 22 | 23 | orig, err := termios.Tcgetattr(uintptr(fd)) 24 | if err != nil { 25 | return nil, err 26 | } 27 | t := Term{name: name, fd: fd, orig: *orig} 28 | if err := t.SetOption(options...); err != nil { 29 | return nil, err 30 | } 31 | return &t, unix.SetNonblock(t.fd, false) 32 | } 33 | 34 | // Restore restores the state of the terminal captured at the point that 35 | // the terminal was originally opened. 36 | func (t *Term) Restore() error { 37 | return termios.Tcsetattr(uintptr(t.fd), termios.TCIOFLUSH, &t.orig) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/doc.go: -------------------------------------------------------------------------------- 1 | // Package termios implements the low level termios(3) terminal line discipline facilities. 2 | // 3 | // For a higher level interface please use the github.com/pkg/term package. 4 | package termios 5 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/ioctl.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package termios 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | func ioctl(fd, request, argp uintptr) error { 8 | return unix.IoctlSetInt(int(fd), uint(request), int(argp)) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/pty.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package termios 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | func open_device(path string) (uintptr, error) { 13 | fd, err := unix.Open(path, unix.O_NOCTTY|unix.O_RDWR|unix.O_CLOEXEC, 0666) 14 | if err != nil { 15 | return 0, fmt.Errorf("unable to open %q: %v", path, err) 16 | } 17 | return uintptr(fd), nil 18 | } 19 | 20 | // Pty returns a UNIX 98 pseudoterminal device. 21 | // Pty returns a pair of fds representing the master and slave pair. 22 | func Pty() (*os.File, *os.File, error) { 23 | ptm, err := open_pty_master() 24 | if err != nil { 25 | return nil, nil, err 26 | } 27 | 28 | sname, err := Ptsname(ptm) 29 | if err != nil { 30 | unix.Close(int(ptm)) 31 | return nil, nil, err 32 | } 33 | 34 | err = grantpt(ptm) 35 | if err != nil { 36 | unix.Close(int(ptm)) 37 | return nil, nil, err 38 | } 39 | 40 | err = unlockpt(ptm) 41 | if err != nil { 42 | unix.Close(int(ptm)) 43 | return nil, nil, err 44 | } 45 | 46 | pts, err := open_device(sname) 47 | if err != nil { 48 | unix.Close(int(ptm)) 49 | return nil, nil, err 50 | } 51 | return os.NewFile(uintptr(ptm), "ptm"), os.NewFile(uintptr(pts), sname), nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/pty_cgo.go: -------------------------------------------------------------------------------- 1 | // +build dragonfly openbsd solaris 2 | 3 | package termios 4 | 5 | // #include 6 | import "C" 7 | 8 | import "syscall" 9 | 10 | func open_pty_master() (uintptr, error) { 11 | rc := C.posix_openpt(syscall.O_NOCTTY | syscall.O_RDWR) 12 | if rc < 0 { 13 | return 0, syscall.Errno(rc) 14 | } 15 | return uintptr(rc), nil 16 | } 17 | 18 | func Ptsname(fd uintptr) (string, error) { 19 | slavename := C.GoString(C.ptsname(C.int(fd))) 20 | return slavename, nil 21 | } 22 | 23 | func grantpt(fd uintptr) error { 24 | rc := C.grantpt(C.int(fd)) 25 | if rc == 0 { 26 | return nil 27 | } 28 | return syscall.Errno(rc) 29 | } 30 | 31 | func unlockpt(fd uintptr) error { 32 | rc := C.unlockpt(C.int(fd)) 33 | if rc == 0 { 34 | return nil 35 | } 36 | return syscall.Errno(rc) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/pty_darwin.go: -------------------------------------------------------------------------------- 1 | package termios 2 | 3 | import ( 4 | "errors" 5 | "unsafe" 6 | 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func open_pty_master() (uintptr, error) { 11 | return open_device("/dev/ptmx") 12 | } 13 | 14 | const ( 15 | _IOC_PARAM_SHIFT = 13 16 | _IOC_PARAM_MASK = (1 << _IOC_PARAM_SHIFT) - 1 17 | ) 18 | 19 | func _IOC_PARM_LEN(ioctl uintptr) uintptr { 20 | return (ioctl >> 16) & _IOC_PARAM_MASK 21 | } 22 | 23 | func Ptsname(fd uintptr) (string, error) { 24 | n := make([]byte, _IOC_PARM_LEN(unix.TIOCPTYGNAME)) 25 | 26 | err := ioctl(fd, unix.TIOCPTYGNAME, uintptr(unsafe.Pointer(&n[0]))) 27 | if err != nil { 28 | return "", err 29 | } 30 | 31 | for i, c := range n { 32 | if c == 0 { 33 | return string(n[:i]), nil 34 | } 35 | } 36 | return "", errors.New("TIOCPTYGNAME string not NUL-terminated") 37 | } 38 | 39 | func grantpt(fd uintptr) error { 40 | return unix.IoctlSetInt(int(fd), unix.TIOCPTYGRANT, 0) 41 | } 42 | 43 | func unlockpt(fd uintptr) error { 44 | return unix.IoctlSetInt(int(fd), unix.TIOCPTYUNLK, 0) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/pty_freebsd.go: -------------------------------------------------------------------------------- 1 | package termios 2 | 3 | import ( 4 | "fmt" 5 | 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func posix_openpt(oflag int) (fd uintptr, err error) { 10 | // Copied from debian-golang-pty/pty_freebsd.go. 11 | r0, _, e1 := unix.Syscall(unix.SYS_POSIX_OPENPT, uintptr(oflag), 0, 0) 12 | fd = uintptr(r0) 13 | if e1 != 0 { 14 | err = e1 15 | } 16 | return 17 | } 18 | 19 | func open_pty_master() (uintptr, error) { 20 | return posix_openpt(unix.O_NOCTTY | unix.O_RDWR | unix.O_CLOEXEC) 21 | } 22 | 23 | func Ptsname(fd uintptr) (string, error) { 24 | n, err := unix.IoctlGetInt(int(fd), unix.TIOCGPTN) 25 | return fmt.Sprintf("/dev/pts/%d", n), err 26 | } 27 | 28 | func grantpt(fd uintptr) error { 29 | return unix.IoctlSetInt(int(fd), unix.TIOCGPTN, 0) 30 | } 31 | 32 | func unlockpt(fd uintptr) error { 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/pty_linux.go: -------------------------------------------------------------------------------- 1 | package termios 2 | 3 | import ( 4 | "fmt" 5 | "unsafe" 6 | 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func open_pty_master() (uintptr, error) { 11 | return open_device("/dev/ptmx") 12 | } 13 | 14 | func Ptsname(fd uintptr) (string, error) { 15 | n, err := unix.IoctlGetInt(int(fd), unix.TIOCGPTN) 16 | return fmt.Sprintf("/dev/pts/%d", n), err 17 | } 18 | 19 | func grantpt(fd uintptr) error { 20 | var n uintptr 21 | return ioctl(fd, unix.TIOCGPTN, uintptr(unsafe.Pointer(&n))) 22 | } 23 | 24 | func unlockpt(fd uintptr) error { 25 | var n uintptr 26 | return ioctl(fd, unix.TIOCSPTLCK, uintptr(unsafe.Pointer(&n))) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/pty_netbsd.go: -------------------------------------------------------------------------------- 1 | package termios 2 | 3 | import ( 4 | "bytes" 5 | 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | func open_pty_master() (uintptr, error) { 10 | return open_device("/dev/ptmx") 11 | } 12 | 13 | func Ptsname(fd uintptr) (string, error) { 14 | ptm, err := unix.IoctlGetPtmget(int(fd), unix.TIOCPTSNAME) 15 | if err != nil { 16 | return "", err 17 | } 18 | return string(ptm.Sn[:bytes.IndexByte(ptm.Sn[:], 0)]), nil 19 | } 20 | 21 | func grantpt(fd uintptr) error { 22 | return unix.IoctlSetInt(int(fd), unix.TIOCGRANTPT, 0) 23 | } 24 | 25 | func unlockpt(fd uintptr) error { 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/termios.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package termios 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Tiocmget returns the state of the MODEM bits. 10 | func Tiocmget(fd uintptr) (int, error) { 11 | return unix.IoctlGetInt(int(fd), unix.TIOCMGET) 12 | } 13 | 14 | // Tiocmset sets the state of the MODEM bits. 15 | func Tiocmset(fd uintptr, status int) error { 16 | return unix.IoctlSetInt(int(fd), unix.TIOCMSET, status) 17 | } 18 | 19 | // Tiocmbis sets the indicated modem bits. 20 | func Tiocmbis(fd uintptr, status int) error { 21 | return unix.IoctlSetPointerInt(int(fd), unix.TIOCMBIS, status) 22 | } 23 | 24 | // Tiocmbic clears the indicated modem bits. 25 | func Tiocmbic(fd uintptr, status int) error { 26 | return unix.IoctlSetPointerInt(int(fd), unix.TIOCMBIC, status) 27 | } 28 | 29 | // Tiocoutq return the number of bytes in the output buffer. 30 | func Tiocoutq(fd uintptr) (int, error) { 31 | return unix.IoctlGetInt(int(fd), unix.TIOCOUTQ) 32 | } 33 | 34 | // Cfmakecbreak modifies attr for cbreak mode. 35 | func Cfmakecbreak(attr *unix.Termios) { 36 | attr.Lflag &^= unix.ECHO | unix.ICANON 37 | attr.Cc[unix.VMIN] = 1 38 | attr.Cc[unix.VTIME] = 0 39 | } 40 | 41 | // Cfmakeraw modifies attr for raw mode. 42 | func Cfmakeraw(attr *unix.Termios) { 43 | attr.Iflag &^= unix.BRKINT | unix.ICRNL | unix.INPCK | unix.ISTRIP | unix.IXON 44 | attr.Oflag &^= unix.OPOST 45 | attr.Cflag &^= unix.CSIZE | unix.PARENB 46 | attr.Cflag |= unix.CS8 47 | attr.Lflag &^= unix.ECHO | unix.ICANON | unix.IEXTEN | unix.ISIG 48 | attr.Cc[unix.VMIN] = 1 49 | attr.Cc[unix.VTIME] = 0 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/termios_const.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!solaris 2 | 3 | package termios 4 | 5 | const ( 6 | TCIFLUSH = 0 7 | TCOFLUSH = 1 8 | TCIOFLUSH = 2 9 | 10 | TCSANOW = 0 11 | TCSADRAIN = 1 12 | TCSAFLUSH = 2 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/term/termios/termios_const_solaris.go: -------------------------------------------------------------------------------- 1 | package termios 2 | 3 | // #include 4 | import "C" 5 | 6 | const ( 7 | TCIFLUSH = C.TCIFLUSH 8 | TCOFLUSH = C.TCOFLUSH 9 | TCIOFLUSH = C.TCIOFLUSH 10 | 11 | TCSANOW = C.TCSANOW 12 | TCSADRAIN = C.TCSADRAIN 13 | TCSAFLUSH = C.TCSAFLUSH 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/github.com/unknwon/goconfig/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.iml 3 | .idea -------------------------------------------------------------------------------- /vendor/github.com/unknwon/goconfig/README_ZH.md: -------------------------------------------------------------------------------- 1 | goconfig [![Build Status](https://drone.io/github.com/Unknwon/goconfig/status.png)](https://drone.io/github.com/Unknwon/goconfig/latest) [![Go Walker](http://gowalker.org/api/v1/badge)](http://gowalker.org/github.com/Unknwon/goconfig) 2 | ======== 3 | 4 | 本库已被 [《Go名库讲解》](https://github.com/Unknwon/go-rock-libraries-showcases/tree/master/lectures/01-goconfig) 收录讲解,欢迎前往学习如何使用! 5 | 6 | 编码规范:基于 [Go 编码规范](https://github.com/Unknwon/go-code-convention) 7 | 8 | ## 关于 9 | 10 | 包 goconfig 是一个易于使用,支持注释的 Go 语言配置文件解析器,该文件的书写格式和 Windows 下的 INI 文件一样。 11 | 12 | 配置文件由形为 `[section]` 的节构成,内部使用 `name:value` 或 `name=value` 这样的键值对;每行开头和尾部的空白符号都将被忽略;如果未指定任何节,则会默认放入名为 `DEFAULT` 的节当中;可以使用 “;” 或 “#” 来作为注释的开头,并可以放置于任意的单独一行中。 13 | 14 | ## 特性 15 | 16 | - 简化流程,易于理解,更少出错。 17 | - 提供与 Windows API 一模一样的操作方式。 18 | - 支持读取递归节。 19 | - 支持自增键名。 20 | - 支持对注释的 **读** 和 **写** 操作,其它所有解析器都不支持!!!! 21 | - 可以直接返回 bool, float64, int, int64 和 string 类型的值,如果使用 “Must” 开头的方法,则一定会返回这个类型的一个值而不返回错误,如果错误发生则会返回零值。 22 | - 支持加载多个文件来重写值。 23 | 24 | ## 安装 25 | 26 | go get github.com/Unknwon/goconfig 27 | 28 | 或 29 | 30 | gopm get github.com/Unknwon/goconfig 31 | 32 | 33 | ## API 文档 34 | 35 | [Go Walker](http://gowalker.org/github.com/Unknwon/goconfig). 36 | 37 | ## 示例 38 | 39 | 请查看 [conf.ini](testdata/conf.ini) 文件作为使用示例。 40 | 41 | ### 用例 42 | 43 | - 函数 `LoadConfigFile` 加载一个或多个文件,然后返回一个类型为 `ConfigFile` 的变量。 44 | - `GetValue` 可以简单的获取某个值。 45 | - 像 `Bool`、`Int`、`Int64` 这样的方法会直接返回指定类型的值。 46 | - 以 `Must` 开头的方法不会返回错误,但当错误发生时会返回零值。 47 | - `SetValue` 可以设置某个值。 48 | - `DeleteKey` 可以删除某个键。 49 | - 最后,`SaveConfigFile` 可以保持您的配置到本地文件系统。 50 | - 使用方法 `Reload` 可以重载您的配置文件。 51 | 52 | ## 更多信息 53 | 54 | - 所有字符都是大小写敏感的! 55 | 56 | ## 参考信息 57 | 58 | - [goconf](http://code.google.com/p/goconf/) 59 | - [robfig/config](https://github.com/robfig/config) 60 | - [Delete an item from a slice](https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/lYz8ftASMQ0) 61 | 62 | ## 授权许可 63 | 64 | 本项目采用 Apache v2 开源授权许可证,完整的授权说明已放置在 [LICENSE](LICENSE) 文件中。 65 | -------------------------------------------------------------------------------- /vendor/github.com/unknwon/goconfig/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // 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, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package goconfig 16 | 17 | // deepCopy will copy a new map with different address 18 | func deepCopy(d map[string]string) map[string]string { 19 | rs := make(map[string]string) 20 | for k, v := range d { 21 | rs[k] = v 22 | } 23 | 24 | return rs 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/burnfont/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !*.* 3 | !*/ 4 | *.o 5 | *.swp 6 | *.tmp 7 | *.bak 8 | *.pro.user 9 | *CMakeFiles* 10 | *.dblite 11 | *.so 12 | .vscode 13 | *.svg 14 | !img/* 15 | cmd/*/*.png 16 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/burnfont/README.md: -------------------------------------------------------------------------------- 1 | # burnfont ![Build](https://github.com/xyproto/burnfont/workflows/Build/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/burnfont)](https://goreportcard.com/report/github.com/xyproto/burnfont) [![License](https://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/burnfont/main/LICENSE) [![GoDoc](https://godoc.org/github.com/xyproto/burnfont?status.svg)](https://godoc.org/github.com/xyproto/burnfont) 2 | 3 | This is a hand-crafted 6x6 pixel font, defined by code, originally created in 1997. 4 | 5 | Here is a generated image with all available letters in this font: 6 | 7 | ![letters](img/letters.png) 8 | 9 | Here is the same image, but scaled up 4x: 10 | 11 | ![scaled](img/scaled.png) 12 | 13 | The font is a bit nostalgic to me, and was used in my small DOS drawing program named *Burn*. The palette that came with *Burn* is [available here](https://github.com/xyproto/burnpalette). The GUI was drawn with 320x200 pixels, 256 indexed colors (`mode 13h`), and looked like this: 14 | 15 | ![burn screenshot](img/burn.png) 16 | 17 | 18 | The font definition looks like this: 19 | 20 | ```go 21 | case 'k': 22 | fontLine("***", x, y) 23 | fontLine("-**", x, y+1) 24 | fontLine("**-**", x+1, y+2) 25 | fontLine("****-", x+1, y+3) 26 | fontLine("-**-**", x, y+4) 27 | fontLine("*** **", x, y+5) 28 | ``` 29 | 30 | `*` is a 100% opaque pixel, while `-` is a 25% opaque one (mostly transparent). 31 | 32 | ## Contents 33 | 34 | This Go package has a slice `Available` that lists all available runes. There is also a `Draw` function that takes an `*image.RGBA` value, a rune, a position (x and y) and a color (r, g and b) and draws a letter at that position in the image. 35 | 36 | * The `cmd/scaled` example outputs an image where each "pixel" of the font is 4x4 pixels. 37 | * The `cmd/letters` example outputs an image where each pixel is a pixel. 38 | * The `cmd/txt2png` example can render text as a PNG image. 39 | 40 | ## Generating an image 41 | 42 | The `scaled` utility can be built and run like this: 43 | 44 | cd cmd/scaled 45 | go build 46 | ./scaled 47 | 48 | ## General information 49 | 50 | * License: BSD-3 51 | * Version: 1.2.3 52 | * Author: Alexander F. Rødseth <xyproto@archlinux.org> 53 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/burnfont/render.go: -------------------------------------------------------------------------------- 1 | package burnfont 2 | 3 | import ( 4 | "image" 5 | "image/color" 6 | "image/draw" 7 | "image/png" 8 | "os" 9 | "strings" 10 | ) 11 | 12 | // SavePNG will render the given text to an image and save 13 | // it as a .png image (using the given filename). 14 | func SavePNG(text, filename string) error { 15 | 16 | spacesPerTab := 4 17 | 18 | // Find the longest line 19 | maxlen := 0 20 | lines := strings.Split(text, "\n") 21 | for _, line := range lines { 22 | if len(line) > maxlen { 23 | maxlen = len(line) 24 | } 25 | } 26 | 27 | lineHeight := 14 28 | marginRight := 4 * lineHeight 29 | width := 8*(maxlen+1) + marginRight 30 | height := (len(lines) * lineHeight) + 2*lineHeight 31 | 32 | dimension := image.Rectangle{image.Point{}, image.Point{width, height}} 33 | 34 | textImage := image.NewRGBA(dimension) 35 | finalImage := image.NewRGBA(dimension) 36 | 37 | darkgray := color.NRGBA{0x10, 0x10, 0x10, 0xff} 38 | white := color.NRGBA{0xff, 0xff, 0xff, 0xff} 39 | 40 | draw.Draw(finalImage, finalImage.Bounds(), &image.Uniform{white}, image.Point{}, draw.Src) 41 | 42 | // For each line of this text document, draw the string to an image 43 | var contents string 44 | for i, line := range lines { 45 | // Expand tabs for each line 46 | contents = strings.Replace(line, "\t", strings.Repeat(" ", spacesPerTab), -1) 47 | // Draw the string to the textImage 48 | DrawString(textImage, lineHeight, (i+1)*lineHeight, contents, darkgray) 49 | } 50 | 51 | // Now overlay the text image on top of the final image with the background color 52 | draw.Draw(finalImage, finalImage.Bounds(), textImage, image.Point{}, draw.Over) 53 | 54 | // Write the PNG file 55 | f, err := os.Create(filename) 56 | if err != nil { 57 | return err 58 | } 59 | return png.Encode(f, finalImage) 60 | } 61 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2025 Alexander F. Rødseth 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/etc.go: -------------------------------------------------------------------------------- 1 | package env 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "os" 7 | "strings" 8 | ) 9 | 10 | // isDir checks if the given path is a directory (could also be a symlink) 11 | func isDir(path string) bool { 12 | fi, err := os.Stat(path) 13 | return err == nil && fi.IsDir() 14 | } 15 | 16 | // EtcEnvironment tries to find the value of the given variable name in /etc/environment. 17 | // The variable name could be ie. "JAVA_HOME". 18 | func EtcEnvironment(envVarName string) (string, error) { 19 | // Find the definition of ie. JAVA_HOME within /etc/environment 20 | data, err := os.ReadFile("/etc/environment") 21 | if err != nil { 22 | return "", err 23 | } 24 | lines := bytes.Split(data, []byte{'\n'}) 25 | for _, line := range lines { 26 | if bytes.Contains(line, []byte(envVarName)) && bytes.Count(line, []byte("=")) == 1 { 27 | fields := bytes.SplitN(line, []byte("="), 2) 28 | javaPath := strings.TrimSpace(string(fields[1])) 29 | if !isDir(javaPath) { 30 | continue 31 | } 32 | return javaPath, nil 33 | } 34 | } 35 | return "", fmt.Errorf("could not find the value of %s in /etc/environment", envVarName) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir.go: -------------------------------------------------------------------------------- 1 | //go:build !android && !ios && !plan9 && !windows 2 | 3 | package env 4 | 5 | import "fmt" 6 | 7 | const home = "HOME" 8 | 9 | // userHomeDir is the same as os.UserHomeDir, except that "getenv" is called instead of "os.Getenv" 10 | // (for caching). Also, the two switch statements are combined into just one. 11 | func userHomeDir() (string, error) { 12 | value := getenv(home) 13 | if value == "" { 14 | return "", fmt.Errorf("$%s is not defined", home) 15 | } 16 | return value, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_android.go: -------------------------------------------------------------------------------- 1 | //go:build android 2 | 3 | package env 4 | 5 | // userHomeDir returns the same value as os.UserHomeDir for Android 6 | func userHomeDir() (string, error) { 7 | return "/sdcard", nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_ios.go: -------------------------------------------------------------------------------- 1 | //go:build ios 2 | 3 | package env 4 | 5 | // userHomeDir returns the same value as os.UserHomeDir for iOS 6 | func userHomeDir() (string, error) { 7 | return "/", nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | 3 | package env 4 | 5 | import "fmt" 6 | 7 | const home = "home" 8 | 9 | // userHomeDir is the same as os.UserHomeDir, except that "getenv" is called instead of "os.Getenv" 10 | // (for caching). Also, the two switch statements are combined into just one. 11 | func userHomeDir() (string, error) { 12 | value := getenv(home) 13 | if value == "" { 14 | return "", fmt.Errorf("$%s is not defined", home) 15 | } 16 | return value, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package env 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | // userHomeDir is the same as os.UserHomeDir, except that "getenv" is called instead of "os.Getenv" 10 | // (for caching). Also, the two switch statements are combined into just one. 11 | func userHomeDir() (string, error) { 12 | value := getenv("USERPROFILE") 13 | if value == "" { 14 | return "", errors.New("%userprofile% is not defined") 15 | } 16 | return value, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/session.go: -------------------------------------------------------------------------------- 1 | package env 2 | 3 | import "strings" 4 | 5 | // WaylandSession returns true of XDG_SESSION_TYPE is "wayland" or if 6 | // DESKTOP_SESSION contains "wayland". 7 | func WaylandSession() bool { 8 | return Str("XDG_SESSION_TYPE") == "wayland" || Has("WAYLAND_DISPLAY") || strings.Contains(Str("DESKTOP_SESSION"), "wayland") 9 | } 10 | 11 | // XSession returns true if DISPLAY is set. 12 | // X being available is not neccessarily in opposition to Wayland running. 13 | func XSession() bool { 14 | return Has("DISPLAY") 15 | } 16 | 17 | // OnlyXSession returns true if DISPLAY is set and WaylandSession() is false. 18 | func OnlyXSession() bool { 19 | return Has("DISPLAY") && !WaylandSession() 20 | } 21 | 22 | // XOrWaylandSession returns true if DISPLAY is set or WaylandSession() returns true. 23 | func XOrWaylandSession() bool { 24 | return Has("DISPLAY") || WaylandSession() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/textoutput/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | cmd/simple/simple 15 | cmd/extract/extract 16 | cmd/print/print 17 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/textoutput/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2025 Alexander F. Rødseth 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/textoutput/README.md: -------------------------------------------------------------------------------- 1 | # TextOutput 2 | 3 | [![GoDoc](https://godoc.org/github.com/xyproto/textoutput?status.svg)](https://godoc.org/github.com/xyproto/textoutput) [![License](https://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/textoutput/master/LICENSE) [![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/textoutput)](https://goreportcard.com/report/github.com/xyproto/textoutput) 4 | 5 | Package for controlling text output, with or without colors, using VT100 terminal codes. 6 | 7 | [![example use](img/example_use.png)](cmd/print/main.go) 8 | 9 | ## Requirements 10 | 11 | * Go 1.17 or later 12 | 13 | ## General info 14 | 15 | * Version: 1.17.2 16 | * License: BSD-3 17 | * Author: Alexander F. Rødseth <xyproto@archlinux.org> 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | *.test 7 | *.out 8 | 9 | # Object files and cached files 10 | *.o 11 | *.a 12 | *.bak 13 | 14 | # Build directories 15 | bin/ 16 | 17 | # Logs and temp files 18 | *.log 19 | *.tmp 20 | *.swp 21 | *.bak 22 | *.log 23 | .DS_Store 24 | 25 | # Ignore editor or IDE directories 26 | .idea/ 27 | .vscode/ 28 | *.iml 29 | 30 | # cmd directory: ignore everything except Go source files and documentation 31 | cmd/*/* 32 | !cmd/*/*.go 33 | !cmd/*/*.txt 34 | !cmd/*/*.md 35 | !cmd/*/*.rst 36 | !cmd/*/*.asciidoc 37 | !cmd/*/*.1* 38 | 39 | # images not in img/ 40 | *.bmp 41 | *.gif 42 | *.jpeg 43 | *.jpg 44 | *.png 45 | *.webp 46 | !img/* 47 | 48 | # Orbiton include.txt file 49 | include.txt 50 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/.ignore: -------------------------------------------------------------------------------- 1 | vendor 2 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.10" 5 | - "1.11" 6 | - "1.12" 7 | - "1.13" 8 | - "1.14" 9 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2025, Alexander F. Rødseth 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/TODO.md: -------------------------------------------------------------------------------- 1 | # Plans 2 | 3 | - [ ] Use [go-terminput](https://github.com/tj/go-terminput) for keyboard input. 4 | - [ ] Make it possible to resize the terminal for the "shooter" example, add a mutex or channel for writing to the canvas. 5 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/size_windows.go: -------------------------------------------------------------------------------- 1 | package vt100 2 | 3 | import ( 4 | "github.com/nathan-fiscaletti/consolesize-go" 5 | ) 6 | 7 | func TermSize() (uint, uint, error) { 8 | rows, cols := consolesize.GetConsoleSize() 9 | return uint(rows), uint(cols), nil 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/utils.go: -------------------------------------------------------------------------------- 1 | package vt100 2 | 3 | // umin finds the smallest uint 4 | func umin(a, b uint) uint { 5 | if a < b { 6 | return a 7 | } 8 | return b 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/vt100/words.go: -------------------------------------------------------------------------------- 1 | package vt100 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // Words takes a string with words and several color-strings, like "blue". Color the 8 | // words with the corresponding colors and return the string. 9 | func Words(line string, colors ...string) string { 10 | var ok bool 11 | words := strings.Split(line, " ") 12 | // Starting out with light gray, then using the last set color for the rest of the words 13 | color := LightGray 14 | coloredWords := make([]string, len(words)) 15 | for i, word := range words { 16 | if i < len(colors) { 17 | prevColor := color 18 | color, ok = LightColorMap[colors[i]] 19 | if !ok { 20 | // Use the previous color if this color string was not found 21 | color = prevColor 22 | } 23 | } 24 | coloredWords[i] = color.Get(word) 25 | } 26 | return strings.Join(coloredWords, " ") 27 | } 28 | 29 | // ColorString takes a string with words to be colored and another string with colors with 30 | // which to color the words. Example strings: "hello there" and "red blue". 31 | func ColorString(line, colors string) string { 32 | return Words(line, strings.Split(colors, " ")...) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/yhat/scrape/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, yhat 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/yhat/scrape/README.md: -------------------------------------------------------------------------------- 1 | # scrape 2 | 3 | A simple, higher level interface for Go web scraping. 4 | 5 | When scraping with Go, I find myself redefining tree traversal and other 6 | utility functions. 7 | 8 | This package is a place to put some simple tools which build on top of the 9 | [Go HTML parsing library](https://godoc.org/golang.org/x/net/html). 10 | 11 | For the full interface check out the godoc 12 | [![GoDoc](https://godoc.org/github.com/yhat/scrape?status.svg)](https://godoc.org/github.com/yhat/scrape) 13 | 14 | ## Sample 15 | 16 | Scrape defines traversal functions like `Find` and `FindAll` while attempting 17 | to be generic. It also defines convenience functions such as `Attr` and `Text`. 18 | 19 | ```go 20 | // Parse the page 21 | root, err := html.Parse(resp.Body) 22 | if err != nil { 23 | // handle error 24 | } 25 | // Search for the title 26 | title, ok := scrape.Find(root, scrape.ByTag(atom.Title)) 27 | if ok { 28 | // Print the title 29 | fmt.Println(scrape.Text(title)) 30 | } 31 | ``` 32 | 33 | ## A full example: Scraping Hacker News 34 | 35 | ```go 36 | package main 37 | 38 | import ( 39 | "fmt" 40 | "net/http" 41 | 42 | "github.com/yhat/scrape" 43 | "golang.org/x/net/html" 44 | "golang.org/x/net/html/atom" 45 | ) 46 | 47 | func main() { 48 | // request and parse the front page 49 | resp, err := http.Get("https://news.ycombinator.com/") 50 | if err != nil { 51 | panic(err) 52 | } 53 | root, err := html.Parse(resp.Body) 54 | if err != nil { 55 | panic(err) 56 | } 57 | 58 | // define a matcher 59 | matcher := func(n *html.Node) bool { 60 | // must check for nil values 61 | if n.DataAtom == atom.A && n.Parent != nil && n.Parent.Parent != nil { 62 | return scrape.Attr(n.Parent.Parent, "class") == "athing" 63 | } 64 | return false 65 | } 66 | // grab all articles and print them 67 | articles := scrape.FindAll(root, matcher) 68 | for i, article := range articles { 69 | fmt.Printf("%2d %s (%s)\n", i, scrape.Text(article), scrape.Attr(article, "href")) 70 | } 71 | } 72 | ``` 73 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 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 LLC 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/net/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/net/html/iter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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.23 6 | 7 | package html 8 | 9 | import "iter" 10 | 11 | // Ancestors returns an iterator over the ancestors of n, starting with n.Parent. 12 | // 13 | // Mutating a Node or its parents while iterating may have unexpected results. 14 | func (n *Node) Ancestors() iter.Seq[*Node] { 15 | _ = n.Parent // eager nil check 16 | 17 | return func(yield func(*Node) bool) { 18 | for p := n.Parent; p != nil && yield(p); p = p.Parent { 19 | } 20 | } 21 | } 22 | 23 | // ChildNodes returns an iterator over the immediate children of n, 24 | // starting with n.FirstChild. 25 | // 26 | // Mutating a Node or its children while iterating may have unexpected results. 27 | func (n *Node) ChildNodes() iter.Seq[*Node] { 28 | _ = n.FirstChild // eager nil check 29 | 30 | return func(yield func(*Node) bool) { 31 | for c := n.FirstChild; c != nil && yield(c); c = c.NextSibling { 32 | } 33 | } 34 | 35 | } 36 | 37 | // Descendants returns an iterator over all nodes recursively beneath 38 | // n, excluding n itself. Nodes are visited in depth-first preorder. 39 | // 40 | // Mutating a Node or its descendants while iterating may have unexpected results. 41 | func (n *Node) Descendants() iter.Seq[*Node] { 42 | _ = n.FirstChild // eager nil check 43 | 44 | return func(yield func(*Node) bool) { 45 | n.descendants(yield) 46 | } 47 | } 48 | 49 | func (n *Node) descendants(yield func(*Node) bool) bool { 50 | for c := range n.ChildNodes() { 51 | if !yield(c) || !c.descendants(yield) { 52 | return false 53 | } 54 | } 55 | return true 56 | } 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 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 LLC 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/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/affinity_linux.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 | // CPU affinity functions 6 | 7 | package unix 8 | 9 | import ( 10 | "math/bits" 11 | "unsafe" 12 | ) 13 | 14 | const cpuSetSize = _CPU_SETSIZE / _NCPUBITS 15 | 16 | // CPUSet represents a CPU affinity mask. 17 | type CPUSet [cpuSetSize]cpuMask 18 | 19 | func schedAffinity(trap uintptr, pid int, set *CPUSet) error { 20 | _, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set))) 21 | if e != 0 { 22 | return errnoErr(e) 23 | } 24 | return nil 25 | } 26 | 27 | // SchedGetaffinity gets the CPU affinity mask of the thread specified by pid. 28 | // If pid is 0 the calling thread is used. 29 | func SchedGetaffinity(pid int, set *CPUSet) error { 30 | return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set) 31 | } 32 | 33 | // SchedSetaffinity sets the CPU affinity mask of the thread specified by pid. 34 | // If pid is 0 the calling thread is used. 35 | func SchedSetaffinity(pid int, set *CPUSet) error { 36 | return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set) 37 | } 38 | 39 | // Zero clears the set s, so that it contains no CPUs. 40 | func (s *CPUSet) Zero() { 41 | for i := range s { 42 | s[i] = 0 43 | } 44 | } 45 | 46 | func cpuBitsIndex(cpu int) int { 47 | return cpu / _NCPUBITS 48 | } 49 | 50 | func cpuBitsMask(cpu int) cpuMask { 51 | return cpuMask(1 << (uint(cpu) % _NCPUBITS)) 52 | } 53 | 54 | // Set adds cpu to the set s. 55 | func (s *CPUSet) Set(cpu int) { 56 | i := cpuBitsIndex(cpu) 57 | if i < len(s) { 58 | s[i] |= cpuBitsMask(cpu) 59 | } 60 | } 61 | 62 | // Clear removes cpu from the set s. 63 | func (s *CPUSet) Clear(cpu int) { 64 | i := cpuBitsIndex(cpu) 65 | if i < len(s) { 66 | s[i] &^= cpuBitsMask(cpu) 67 | } 68 | } 69 | 70 | // IsSet reports whether cpu is in the set s. 71 | func (s *CPUSet) IsSet(cpu int) bool { 72 | i := cpuBitsIndex(cpu) 73 | if i < len(s) { 74 | return s[i]&cpuBitsMask(cpu) != 0 75 | } 76 | return false 77 | } 78 | 79 | // Count returns the number of CPUs in the set s. 80 | func (s *CPUSet) Count() int { 81 | c := 0 82 | for _, b := range s { 83 | c += bits.OnesCount64(uint64(b)) 84 | } 85 | return c 86 | } 87 | -------------------------------------------------------------------------------- /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 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 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-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 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-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 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-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 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-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.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 (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 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 ·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_riscv64.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 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 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-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 14 | // instead of the glibc-specific "CALL 0x10(GS)". 15 | #define INVOKE_SYSCALL INT $0x80 16 | 17 | // Just jump to package syscall's implementation for all these functions. 18 | // The runtime may know about them. 19 | 20 | TEXT ·Syscall(SB),NOSPLIT,$0-28 21 | JMP syscall·Syscall(SB) 22 | 23 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·Syscall6(SB) 25 | 26 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 27 | CALL runtime·entersyscall(SB) 28 | MOVL trap+0(FP), AX // syscall entry 29 | MOVL a1+4(FP), BX 30 | MOVL a2+8(FP), CX 31 | MOVL a3+12(FP), DX 32 | MOVL $0, SI 33 | MOVL $0, DI 34 | INVOKE_SYSCALL 35 | MOVL AX, r1+16(FP) 36 | MOVL DX, r2+20(FP) 37 | CALL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVL trap+0(FP), AX // syscall entry 48 | MOVL a1+4(FP), BX 49 | MOVL a2+8(FP), CX 50 | MOVL a3+12(FP), DX 51 | MOVL $0, SI 52 | MOVL $0, DI 53 | INVOKE_SYSCALL 54 | MOVL AX, r1+16(FP) 55 | MOVL DX, r2+20(FP) 56 | RET 57 | 58 | TEXT ·socketcall(SB),NOSPLIT,$0-36 59 | JMP syscall·socketcall(SB) 60 | 61 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 62 | JMP syscall·rawsocketcall(SB) 63 | 64 | TEXT ·seek(SB),NOSPLIT,$0-28 65 | JMP syscall·seek(SB) 66 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 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 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL 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 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 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-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 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-56 13 | B syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 16 | B syscall·Syscall6(SB) 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R0 21 | MOVD a2+16(FP), R1 22 | MOVD a3+24(FP), R2 23 | MOVD $0, R3 24 | MOVD $0, R4 25 | MOVD $0, R5 26 | MOVD trap+0(FP), R8 // syscall entry 27 | SVC 28 | MOVD R0, r1+32(FP) // r1 29 | MOVD R1, r2+40(FP) // r2 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | B syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | B syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOVD a1+8(FP), R0 41 | MOVD a2+16(FP), R1 42 | MOVD a3+24(FP), R2 43 | MOVD $0, R3 44 | MOVD $0, R4 45 | MOVD $0, R5 46 | MOVD trap+0(FP), R8 // syscall entry 47 | SVC 48 | MOVD R0, r1+32(FP) 49 | MOVD R1, r2+40(FP) 50 | RET 51 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | 10 | // Just jump to package syscall's implementation for all these functions. 11 | // The runtime may know about them. 12 | 13 | TEXT ·Syscall(SB),NOSPLIT,$0-56 14 | JMP syscall·Syscall(SB) 15 | 16 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 17 | JMP syscall·Syscall6(SB) 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | JAL runtime·entersyscall(SB) 21 | MOVV a1+8(FP), R4 22 | MOVV a2+16(FP), R5 23 | MOVV a3+24(FP), R6 24 | MOVV R0, R7 25 | MOVV R0, R8 26 | MOVV R0, R9 27 | MOVV trap+0(FP), R11 // syscall entry 28 | SYSCALL 29 | MOVV R4, r1+32(FP) 30 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 31 | JAL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 35 | JMP syscall·RawSyscall(SB) 36 | 37 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 38 | JMP syscall·RawSyscall6(SB) 39 | 40 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 41 | MOVV a1+8(FP), R4 42 | MOVV a2+16(FP), R5 43 | MOVV a3+24(FP), R6 44 | MOVV R0, R7 45 | MOVV R0, R8 46 | MOVV R0, R9 47 | MOVV trap+0(FP), R11 // syscall entry 48 | SYSCALL 49 | MOVV R4, r1+32(FP) 50 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 51 | RET 52 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips64, Linux 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), R2 // syscall entry 31 | SYSCALL 32 | MOVV R2, r1+32(FP) 33 | MOVV R3, r2+40(FP) 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), R2 // syscall entry 51 | SYSCALL 52 | MOVV R2, r1+32(FP) 53 | MOVV R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips, Linux 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-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 ·SyscallNoError(SB),NOSPLIT,$0-24 26 | JAL runtime·entersyscall(SB) 27 | MOVW a1+4(FP), R4 28 | MOVW a2+8(FP), R5 29 | MOVW a3+12(FP), R6 30 | MOVW R0, R7 31 | MOVW trap+0(FP), R2 // syscall entry 32 | SYSCALL 33 | MOVW R2, r1+16(FP) // r1 34 | MOVW R3, r2+20(FP) // r2 35 | JAL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW a1+4(FP), R4 46 | MOVW a2+8(FP), R5 47 | MOVW a3+12(FP), R6 48 | MOVW trap+0(FP), R2 // syscall entry 49 | SYSCALL 50 | MOVW R2, r1+16(FP) 51 | MOVW R3, r2+20(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for s390x, Linux 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 | BR syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | BR syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | BL runtime·entersyscall(SB) 24 | MOVD a1+8(FP), R2 25 | MOVD a2+16(FP), R3 26 | MOVD a3+24(FP), R4 27 | MOVD $0, R5 28 | MOVD $0, R6 29 | MOVD $0, R7 30 | MOVD trap+0(FP), R1 // syscall entry 31 | SYSCALL 32 | MOVD R2, r1+32(FP) 33 | MOVD R3, r2+40(FP) 34 | BL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | BR syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | BR syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVD a1+8(FP), R2 45 | MOVD a2+16(FP), R3 46 | MOVD a3+24(FP), R4 47 | MOVD $0, R5 48 | MOVD $0, R6 49 | MOVD $0, R7 50 | MOVD trap+0(FP), R1 // syscall entry 51 | SYSCALL 52 | MOVD R2, r1+32(FP) 53 | MOVD R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 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 ·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_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 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/auxv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //go:linkname runtime_getAuxv runtime.getAuxv 15 | func runtime_getAuxv() []uintptr 16 | 17 | // Auxv returns the ELF auxiliary vector as a sequence of key/value pairs. 18 | // The returned slice is always a fresh copy, owned by the caller. 19 | // It returns an error on non-ELF platforms, or if the auxiliary vector cannot be accessed, 20 | // which happens in some locked-down environments and build modes. 21 | func Auxv() ([][2]uintptr, error) { 22 | vec := runtime_getAuxv() 23 | vecLen := len(vec) 24 | 25 | if vecLen == 0 { 26 | return nil, syscall.ENOENT 27 | } 28 | 29 | if vecLen%2 != 0 { 30 | return nil, syscall.EINVAL 31 | } 32 | 33 | result := make([]uintptr, vecLen) 34 | copy(result, vec) 35 | return unsafe.Slice((*[2]uintptr)(unsafe.Pointer(&result[0])), vecLen/2), nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/auxv_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 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.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Auxv() ([][2]uintptr, error) { 12 | return nil, syscall.ENOTSUP 13 | } 14 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /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 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /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 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /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 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /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 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 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/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 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo.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 && !aix && !hurd 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr) 15 | 16 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 17 | 18 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { 19 | syscall.Entersyscall() 20 | r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 21 | syscall.Exitsyscall() 22 | return r, 0 23 | } 24 | 25 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 26 | syscall.Entersyscall() 27 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 28 | syscall.Exitsyscall() 29 | return r, 0, syscall.Errno(errno) 30 | } 31 | 32 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 33 | syscall.Entersyscall() 34 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 35 | syscall.Exitsyscall() 36 | return r, 0, syscall.Errno(errno) 37 | } 38 | 39 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 40 | syscall.Entersyscall() 41 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 42 | syscall.Exitsyscall() 43 | return r, 0, syscall.Errno(errno) 44 | } 45 | 46 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) { 47 | r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 48 | return r, 0 49 | } 50 | 51 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 52 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 53 | return r, 0, syscall.Errno(errno) 54 | } 55 | 56 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 57 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 58 | return r, 0, syscall.Errno(errno) 59 | } 60 | -------------------------------------------------------------------------------- /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 | //go:build gccgo && !aix && !hurd 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | 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) 24 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); 25 | 26 | struct ret 27 | 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) 28 | { 29 | struct ret r; 30 | 31 | errno = 0; 32 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 33 | r.err = errno; 34 | return r; 35 | } 36 | 37 | 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) 38 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); 39 | 40 | uintptr_t 41 | 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) 42 | { 43 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 44 | } 45 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ioctl_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 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | // ioctl itself should not be exposed directly, but additional get/set 15 | // functions for specific types are permissible. 16 | 17 | // IoctlSetInt performs an ioctl operation which sets an integer value 18 | // on fd, using the specified request number. 19 | func IoctlSetInt(fd int, req int, value int) error { 20 | return ioctl(fd, req, uintptr(value)) 21 | } 22 | 23 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 24 | // 25 | // To change fd's window size, the req argument should be TIOCSWINSZ. 26 | func IoctlSetWinsize(fd int, req int, value *Winsize) error { 27 | // TODO: if we get the chance, remove the req parameter and 28 | // hardcode TIOCSWINSZ. 29 | return ioctlPtr(fd, req, unsafe.Pointer(value)) 30 | } 31 | 32 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 33 | // 34 | // The req value is expected to be TCSETS, TCSETSW, or TCSETSF 35 | func IoctlSetTermios(fd int, req int, value *Termios) error { 36 | if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) { 37 | return ENOSYS 38 | } 39 | err := Tcsetattr(fd, int(req), value) 40 | runtime.KeepAlive(value) 41 | return err 42 | } 43 | 44 | // IoctlGetInt performs an ioctl operation which gets an integer value 45 | // from fd, using the specified request number. 46 | // 47 | // A few ioctl requests use the return value as an output parameter; 48 | // for those, IoctlRetInt should be used instead of this function. 49 | func IoctlGetInt(fd int, req int) (int, error) { 50 | var value int 51 | err := ioctlPtr(fd, req, unsafe.Pointer(&value)) 52 | return value, err 53 | } 54 | 55 | func IoctlGetWinsize(fd int, req int) (*Winsize, error) { 56 | var value Winsize 57 | err := ioctlPtr(fd, req, unsafe.Pointer(&value)) 58 | return &value, err 59 | } 60 | 61 | // IoctlGetTermios performs an ioctl on fd with a *Termios. 62 | // 63 | // The req value is expected to be TCGETS 64 | func IoctlGetTermios(fd int, req int) (*Termios, error) { 65 | var value Termios 66 | if req != TCGETS { 67 | return &value, ENOSYS 68 | } 69 | err := Tcgetattr(fd, &value) 70 | return &value, err 71 | } 72 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 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 || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 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 || netbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | type mremapMmapper struct { 12 | mmapper 13 | mremap func(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) 14 | } 15 | 16 | var mapper = &mremapMmapper{ 17 | mmapper: mmapper{ 18 | active: make(map[*byte][]byte), 19 | mmap: mmap, 20 | munmap: munmap, 21 | }, 22 | mremap: mremap, 23 | } 24 | 25 | func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { 26 | if newLength <= 0 || len(oldData) == 0 || len(oldData) != cap(oldData) || flags&mremapFixed != 0 { 27 | return nil, EINVAL 28 | } 29 | 30 | pOld := &oldData[cap(oldData)-1] 31 | m.Lock() 32 | defer m.Unlock() 33 | bOld := m.active[pOld] 34 | if bOld == nil || &bOld[0] != &oldData[0] { 35 | return nil, EINVAL 36 | } 37 | newAddr, errno := m.mremap(uintptr(unsafe.Pointer(&bOld[0])), uintptr(len(bOld)), uintptr(newLength), flags, 0) 38 | if errno != nil { 39 | return nil, errno 40 | } 41 | bNew := unsafe.Slice((*byte)(unsafe.Pointer(newAddr)), newLength) 42 | pNew := &bNew[cap(bNew)-1] 43 | if flags&mremapDontunmap == 0 { 44 | delete(m.active, pOld) 45 | } 46 | m.active[pNew] = bNew 47 | return bNew, nil 48 | } 49 | 50 | func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { 51 | return mapper.Mremap(oldData, newLength, flags) 52 | } 53 | 54 | func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) { 55 | xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr)) 56 | return unsafe.Pointer(xaddr), err 57 | } 58 | -------------------------------------------------------------------------------- /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 || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /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 || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "ios", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | // NetBSD aarch64 requires 128-bit alignment. 36 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 37 | salign = 16 38 | } 39 | case "zos": 40 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 41 | // not pointer width. 42 | salign = SizeofInt 43 | } 44 | 45 | return (salen + salign - 1) & ^(salign - 1) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *(*Ucred)(h.data(0)) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | 38 | // PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO. 39 | func PktInfo4(info *Inet4Pktinfo) []byte { 40 | b := make([]byte, CmsgSpace(SizeofInet4Pktinfo)) 41 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 42 | h.Level = SOL_IP 43 | h.Type = IP_PKTINFO 44 | h.SetLen(CmsgLen(SizeofInet4Pktinfo)) 45 | *(*Inet4Pktinfo)(h.data(0)) = *info 46 | return b 47 | } 48 | 49 | // PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO. 50 | func PktInfo6(info *Inet6Pktinfo) []byte { 51 | b := make([]byte, CmsgSpace(SizeofInet6Pktinfo)) 52 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 53 | h.Level = SOL_IPV6 54 | h.Type = IPV6_PKTINFO 55 | h.SetLen(CmsgLen(SizeofInet6Pktinfo)) 56 | *(*Inet6Pktinfo)(h.data(0)) = *info 57 | return b 58 | } 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // provide the address of function variable to be fixed up. 10 | 11 | TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8 12 | MOVD $·Pipe2(SB), R8 13 | MOVD R8, ret+0(FP) 14 | RET 15 | 16 | TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8 17 | MOVD $·Flock(SB), R8 18 | MOVD R8, ret+0(FP) 19 | RET 20 | 21 | TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 22 | MOVD $·Getxattr(SB), R8 23 | MOVD R8, ret+0(FP) 24 | RET 25 | 26 | TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8 27 | MOVD $·Nanosleep(SB), R8 28 | MOVD R8, ret+0(FP) 29 | RET 30 | 31 | TEXT ·get_SetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8 32 | MOVD $·Setxattr(SB), R8 33 | MOVD R8, ret+0(FP) 34 | RET 35 | 36 | TEXT ·get_Wait4Addr(SB), NOSPLIT|NOFRAME, $0-8 37 | MOVD $·Wait4(SB), R8 38 | MOVD R8, ret+0(FP) 39 | RET 40 | 41 | TEXT ·get_MountAddr(SB), NOSPLIT|NOFRAME, $0-8 42 | MOVD $·Mount(SB), R8 43 | MOVD R8, ret+0(FP) 44 | RET 45 | 46 | TEXT ·get_UnmountAddr(SB), NOSPLIT|NOFRAME, $0-8 47 | MOVD $·Unmount(SB), R8 48 | MOVD R8, ret+0(FP) 49 | RET 50 | 51 | TEXT ·get_UtimesNanoAtAddr(SB), NOSPLIT|NOFRAME, $0-8 52 | MOVD $·UtimesNanoAt(SB), R8 53 | MOVD R8, ret+0(FP) 54 | RET 55 | 56 | TEXT ·get_UtimesNanoAddr(SB), NOSPLIT|NOFRAME, $0-8 57 | MOVD $·UtimesNano(SB), R8 58 | MOVD R8, ret+0(FP) 59 | RET 60 | 61 | TEXT ·get_MkfifoatAddr(SB), NOSPLIT|NOFRAME, $0-8 62 | MOVD $·Mkfifoat(SB), R8 63 | MOVD R8, ret+0(FP) 64 | RET 65 | 66 | TEXT ·get_ChtagAddr(SB), NOSPLIT|NOFRAME, $0-8 67 | MOVD $·Chtag(SB), R8 68 | MOVD R8, ret+0(FP) 69 | RET 70 | 71 | TEXT ·get_ReadlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8 72 | MOVD $·Readlinkat(SB), R8 73 | MOVD R8, ret+0(FP) 74 | RET 75 | 76 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 10 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 11 | 12 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func (iov *Iovec) SetLen(length int) { 23 | iov.Len = uint32(length) 24 | } 25 | 26 | func (msghdr *Msghdr) SetControllen(length int) { 27 | msghdr.Controllen = uint32(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetIovlen(length int) { 31 | msghdr.Iovlen = int32(length) 32 | } 33 | 34 | func (cmsg *Cmsghdr) SetLen(length int) { 35 | cmsg.Len = uint32(length) 36 | } 37 | 38 | func Fstat(fd int, stat *Stat_t) error { 39 | return fstat(fd, stat) 40 | } 41 | 42 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 43 | return fstatat(dirfd, path, stat, flags) 44 | } 45 | 46 | func Lstat(path string, stat *Stat_t) error { 47 | return lstat(path, stat) 48 | } 49 | 50 | func Stat(path string, statptr *Stat_t) error { 51 | return stat(path, statptr) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_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 | 7 | package unix 8 | 9 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 10 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 11 | 12 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 20 | } 21 | 22 | func (iov *Iovec) SetLen(length int) { 23 | iov.Len = uint64(length) 24 | } 25 | 26 | func (msghdr *Msghdr) SetControllen(length int) { 27 | msghdr.Controllen = uint32(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetIovlen(length int) { 31 | msghdr.Iovlen = int32(length) 32 | } 33 | 34 | func (cmsg *Cmsghdr) SetLen(length int) { 35 | cmsg.Len = uint32(length) 36 | } 37 | 38 | // In order to only have Timespec structure, type of Stat_t's fields 39 | // Atim, Mtim and Ctim is changed from StTimespec to Timespec during 40 | // ztypes generation. 41 | // On ppc64, Timespec.Nsec is an int64 while StTimespec.Nsec is an 42 | // int32, so the fields' value must be modified. 43 | func fixStatTimFields(stat *Stat_t) { 44 | stat.Atim.Nsec >>= 32 45 | stat.Mtim.Nsec >>= 32 46 | stat.Ctim.Nsec >>= 32 47 | } 48 | 49 | func Fstat(fd int, stat *Stat_t) error { 50 | err := fstat(fd, stat) 51 | if err != nil { 52 | return err 53 | } 54 | fixStatTimFields(stat) 55 | return nil 56 | } 57 | 58 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 59 | err := fstatat(dirfd, path, stat, flags) 60 | if err != nil { 61 | return err 62 | } 63 | fixStatTimFields(stat) 64 | return nil 65 | } 66 | 67 | func Lstat(path string, stat *Stat_t) error { 68 | err := lstat(path, stat) 69 | if err != nil { 70 | return err 71 | } 72 | fixStatTimFields(stat) 73 | return nil 74 | } 75 | 76 | func Stat(path string, statptr *Stat_t) error { 77 | err := stat(path, statptr) 78 | if err != nil { 79 | return err 80 | } 81 | fixStatTimFields(statptr) 82 | return nil 83 | } 84 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func setTimespec(sec, nsec int64) Timespec { 12 | return Timespec{Sec: sec, Nsec: nsec} 13 | } 14 | 15 | func setTimeval(sec, usec int64) Timeval { 16 | return Timeval{Sec: sec, Usec: int32(usec)} 17 | } 18 | 19 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 20 | k.Ident = uint64(fd) 21 | k.Filter = int16(mode) 22 | k.Flags = uint16(flags) 23 | } 24 | 25 | func (iov *Iovec) SetLen(length int) { 26 | iov.Len = uint64(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetControllen(length int) { 30 | msghdr.Controllen = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetIovlen(length int) { 34 | msghdr.Iovlen = int32(length) 35 | } 36 | 37 | func (cmsg *Cmsghdr) SetLen(length int) { 38 | cmsg.Len = uint32(length) 39 | } 40 | 41 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 42 | 43 | //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 44 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 45 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 46 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 47 | //sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 48 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 49 | //sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 50 | //sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 51 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func setTimespec(sec, nsec int64) Timespec { 12 | return Timespec{Sec: sec, Nsec: nsec} 13 | } 14 | 15 | func setTimeval(sec, usec int64) Timeval { 16 | return Timeval{Sec: sec, Usec: int32(usec)} 17 | } 18 | 19 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 20 | k.Ident = uint64(fd) 21 | k.Filter = int16(mode) 22 | k.Flags = uint16(flags) 23 | } 24 | 25 | func (iov *Iovec) SetLen(length int) { 26 | iov.Len = uint64(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetControllen(length int) { 30 | msghdr.Controllen = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetIovlen(length int) { 34 | msghdr.Iovlen = int32(length) 35 | } 36 | 37 | func (cmsg *Cmsghdr) SetLen(length int) { 38 | cmsg.Len = uint32(length) 39 | } 40 | 41 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 42 | 43 | //sys Fstat(fd int, stat *Stat_t) (err error) 44 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 45 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) 46 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT 47 | //sys Lstat(path string, stat *Stat_t) (err error) 48 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 49 | //sys Stat(path string, stat *Stat_t) (err error) 50 | //sys Statfs(path string, stat *Statfs_t) (err error) 51 | -------------------------------------------------------------------------------- /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 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_darwin.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 19 | 20 | //go:linkname syscall_syscall syscall.syscall 21 | //go:linkname syscall_syscall6 syscall.syscall6 22 | //go:linkname syscall_syscall6X syscall.syscall6X 23 | //go:linkname syscall_syscall9 syscall.syscall9 24 | //go:linkname syscall_rawSyscall syscall.rawSyscall 25 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 26 | //go:linkname syscall_syscallPtr syscall.syscallPtr 27 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 45 | var writtenOut uint64 = 0 46 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 47 | 48 | written = int(writtenOut) 49 | 50 | if e1 != 0 { 51 | err = e1 52 | } 53 | return 54 | } 55 | 56 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint32(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | 62 | func PtraceGetFsBase(pid int, fsbase *int64) (err error) { 63 | return ptracePtr(PT_GETFSBASE, pid, unsafe.Pointer(fsbase), 0) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | 62 | func PtraceGetFsBase(pid int, fsbase *int64) (err error) { 63 | return ptracePtr(PT_GETFSBASE, pid, unsafe.Pointer(fsbase), 0) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.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 arm && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint32(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.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 arm64 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.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 riscv64 && freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.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 hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.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 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_illumos.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 | // illumos system calls not present on Solaris. 6 | 7 | //go:build amd64 && illumos 8 | 9 | package unix 10 | 11 | import ( 12 | "unsafe" 13 | ) 14 | 15 | func bytes2iovec(bs [][]byte) []Iovec { 16 | iovecs := make([]Iovec, len(bs)) 17 | for i, b := range bs { 18 | iovecs[i].SetLen(len(b)) 19 | if len(b) > 0 { 20 | iovecs[i].Base = &b[0] 21 | } else { 22 | iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero)) 23 | } 24 | } 25 | return iovecs 26 | } 27 | 28 | //sys readv(fd int, iovs []Iovec) (n int, err error) 29 | 30 | func Readv(fd int, iovs [][]byte) (n int, err error) { 31 | iovecs := bytes2iovec(iovs) 32 | n, err = readv(fd, iovecs) 33 | return n, err 34 | } 35 | 36 | //sys preadv(fd int, iovs []Iovec, off int64) (n int, err error) 37 | 38 | func Preadv(fd int, iovs [][]byte, off int64) (n int, err error) { 39 | iovecs := bytes2iovec(iovs) 40 | n, err = preadv(fd, iovecs, off) 41 | return n, err 42 | } 43 | 44 | //sys writev(fd int, iovs []Iovec) (n int, err error) 45 | 46 | func Writev(fd int, iovs [][]byte) (n int, err error) { 47 | iovecs := bytes2iovec(iovs) 48 | n, err = writev(fd, iovecs) 49 | return n, err 50 | } 51 | 52 | //sys pwritev(fd int, iovs []Iovec, off int64) (n int, err error) 53 | 54 | func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) { 55 | iovecs := bytes2iovec(iovs) 56 | n, err = pwritev(fd, iovecs, off) 57 | return n, err 58 | } 59 | 60 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) = libsocket.accept4 61 | 62 | func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { 63 | var rsa RawSockaddrAny 64 | var len _Socklen = SizeofSockaddrAny 65 | nfd, err = accept4(fd, &rsa, &len, flags) 66 | if err != nil { 67 | return 68 | } 69 | if len > SizeofSockaddrAny { 70 | panic("RawSockaddrAny too small") 71 | } 72 | sa, err = anyToSockaddr(fd, &rsa) 73 | if err != nil { 74 | Close(nfd) 75 | nfd = 0 76 | } 77 | return 78 | } 79 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.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 openbsd 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 17 | 18 | //go:linkname syscall_syscall syscall.syscall 19 | //go:linkname syscall_syscall6 syscall.syscall6 20 | //go:linkname syscall_syscall10 syscall.syscall10 21 | //go:linkname syscall_rawSyscall syscall.rawSyscall 22 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 23 | 24 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 25 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 26 | } 27 | -------------------------------------------------------------------------------- /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 (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.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 ppc64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.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 riscv64 && openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /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 && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /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 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix.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) || linux || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // SysvShmAttach attaches the Sysv shared memory segment associated with the 12 | // shared memory identifier id. 13 | func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { 14 | addr, errno := shmat(id, addr, flag) 15 | if errno != nil { 16 | return nil, errno 17 | } 18 | 19 | // Retrieve the size of the shared memory to enable slice creation 20 | var info SysvShmDesc 21 | 22 | _, err := SysvShmCtl(id, IPC_STAT, &info) 23 | if err != nil { 24 | // release the shared memory if we can't find the size 25 | 26 | // ignoring error from shmdt as there's nothing sensible to return here 27 | shmdt(addr) 28 | return nil, err 29 | } 30 | 31 | // Use unsafe to convert addr into a []byte. 32 | b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz)) 33 | return b, nil 34 | } 35 | 36 | // SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach. 37 | // 38 | // It is not safe to use the slice after calling this function. 39 | func SysvShmDetach(data []byte) error { 40 | if len(data) == 0 { 41 | return EINVAL 42 | } 43 | 44 | return shmdt(uintptr(unsafe.Pointer(&data[0]))) 45 | } 46 | 47 | // SysvShmGet returns the Sysv shared memory identifier associated with key. 48 | // If the IPC_CREAT flag is specified a new segment is created. 49 | func SysvShmGet(key, size, flag int) (id int, err error) { 50 | return shmget(key, size, flag) 51 | } 52 | -------------------------------------------------------------------------------- /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) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /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 "fmt" 8 | 9 | // Unveil implements the unveil syscall. 10 | // For more information see unveil(2). 11 | // Note that the special case of blocking further 12 | // unveil calls is handled by UnveilBlock. 13 | func Unveil(path string, flags string) error { 14 | if err := supportsUnveil(); err != nil { 15 | return err 16 | } 17 | pathPtr, err := BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | return unveil(pathPtr, flagsPtr) 26 | } 27 | 28 | // UnveilBlock blocks future unveil calls. 29 | // For more information see unveil(2). 30 | func UnveilBlock() error { 31 | if err := supportsUnveil(); err != nil { 32 | return err 33 | } 34 | return unveil(nil, nil) 35 | } 36 | 37 | // supportsUnveil checks for availability of the unveil(2) system call based 38 | // on the running OpenBSD version. 39 | func supportsUnveil() error { 40 | maj, min, err := majmin() 41 | if err != nil { 42 | return err 43 | } 44 | 45 | // unveil is not available before 6.4 46 | if maj < 6 || (maj == 6 && min <= 3) { 47 | return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 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 || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /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 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsArm is the registers used by arm binaries. 10 | type PtraceRegsArm struct { 11 | Uregs [18]uint32 12 | } 13 | 14 | // PtraceGetRegsArm fetches the registers used by arm binaries. 15 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 16 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 17 | } 18 | 19 | // PtraceSetRegsArm sets the registers used by arm binaries. 20 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 21 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 22 | } 23 | 24 | // PtraceRegsArm64 is the registers used by arm64 binaries. 25 | type PtraceRegsArm64 struct { 26 | Regs [31]uint64 27 | Sp uint64 28 | Pc uint64 29 | Pstate uint64 30 | } 31 | 32 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 33 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 34 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 35 | } 36 | 37 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 38 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 39 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 40 | } 41 | -------------------------------------------------------------------------------- /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 ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), 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 ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), 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 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMips is the registers used by mips binaries. 10 | type PtraceRegsMips struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMips fetches the registers used by mips binaries. 21 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMips sets the registers used by mips binaries. 26 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64 is the registers used by mips64 binaries. 31 | type PtraceRegsMips64 struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 42 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 47 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /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 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMipsle is the registers used by mipsle binaries. 10 | type PtraceRegsMipsle struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 21 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 26 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64le is the registers used by mips64le binaries. 31 | type PtraceRegsMips64le struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 42 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 47 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_x86_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT. 2 | 3 | //go:build linux && (386 || amd64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegs386 is the registers used by 386 binaries. 10 | type PtraceRegs386 struct { 11 | Ebx int32 12 | Ecx int32 13 | Edx int32 14 | Esi int32 15 | Edi int32 16 | Ebp int32 17 | Eax int32 18 | Xds int32 19 | Xes int32 20 | Xfs int32 21 | Xgs int32 22 | Orig_eax int32 23 | Eip int32 24 | Xcs int32 25 | Eflags int32 26 | Esp int32 27 | Xss int32 28 | } 29 | 30 | // PtraceGetRegs386 fetches the registers used by 386 binaries. 31 | func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error { 32 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 33 | } 34 | 35 | // PtraceSetRegs386 sets the registers used by 386 binaries. 36 | func PtraceSetRegs386(pid int, regs *PtraceRegs386) error { 37 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 38 | } 39 | 40 | // PtraceRegsAmd64 is the registers used by amd64 binaries. 41 | type PtraceRegsAmd64 struct { 42 | R15 uint64 43 | R14 uint64 44 | R13 uint64 45 | R12 uint64 46 | Rbp uint64 47 | Rbx uint64 48 | R11 uint64 49 | R10 uint64 50 | R9 uint64 51 | R8 uint64 52 | Rax uint64 53 | Rcx uint64 54 | Rdx uint64 55 | Rsi uint64 56 | Rdi uint64 57 | Orig_rax uint64 58 | Rip uint64 59 | Cs uint64 60 | Eflags uint64 61 | Rsp uint64 62 | Ss uint64 63 | Fs_base uint64 64 | Gs_base uint64 65 | Ds uint64 66 | Es uint64 67 | Fs uint64 68 | Gs uint64 69 | } 70 | 71 | // PtraceGetRegsAmd64 fetches the registers used by amd64 binaries. 72 | func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error { 73 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 74 | } 75 | 76 | // PtraceSetRegsAmd64 sets the registers used by amd64 binaries. 77 | func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error { 78 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 79 | } 80 | -------------------------------------------------------------------------------- /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 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /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 | size := unsafe.Sizeof(*block) 41 | for *block != 0 { 42 | // find NUL terminator 43 | end := unsafe.Pointer(block) 44 | for *(*uint16)(end) != 0 { 45 | end = unsafe.Add(end, size) 46 | } 47 | 48 | entry := unsafe.Slice(block, (uintptr(end)-uintptr(unsafe.Pointer(block)))/size) 49 | env = append(env, UTF16ToString(entry)) 50 | block = (*uint16)(unsafe.Add(end, size)) 51 | } 52 | return env, nil 53 | } 54 | 55 | func Unsetenv(key string) error { 56 | return syscall.Unsetenv(key) 57 | } 58 | -------------------------------------------------------------------------------- /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 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /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 | 7 | package windows 8 | 9 | //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 10 | -------------------------------------------------------------------------------- /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 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /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 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /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 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /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/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/mattn/go-colorable v0.1.14 2 | ## explicit; go 1.18 3 | github.com/mattn/go-colorable 4 | # github.com/mattn/go-isatty v0.0.20 5 | ## explicit; go 1.15 6 | github.com/mattn/go-isatty 7 | # github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d 8 | ## explicit 9 | github.com/mgutz/ansi 10 | # github.com/nathan-fiscaletti/consolesize-go v0.0.0-20220204101620-317176b6684d 11 | ## explicit 12 | github.com/nathan-fiscaletti/consolesize-go 13 | # github.com/pkg/term v1.2.0-beta.2.0.20210419004637-f749b98bd0ba 14 | ## explicit; go 1.14 15 | github.com/pkg/term 16 | github.com/pkg/term/termios 17 | # github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 18 | ## explicit 19 | # github.com/unknwon/goconfig v1.0.0 20 | ## explicit 21 | github.com/unknwon/goconfig 22 | # github.com/xyproto/burnfont v1.2.3 23 | ## explicit; go 1.9 24 | github.com/xyproto/burnfont 25 | # github.com/xyproto/env/v2 v2.5.3 26 | ## explicit; go 1.19 27 | github.com/xyproto/env/v2 28 | # github.com/xyproto/textoutput v1.17.2 29 | ## explicit; go 1.23.0 30 | github.com/xyproto/textoutput 31 | # github.com/xyproto/vt100 v1.16.12 32 | ## explicit; go 1.23.0 33 | github.com/xyproto/vt100 34 | # github.com/yhat/scrape v0.0.0-20161128144610-24b7890b0945 35 | ## explicit 36 | github.com/yhat/scrape 37 | # golang.org/x/net v0.40.0 38 | ## explicit; go 1.23.0 39 | golang.org/x/net/html 40 | golang.org/x/net/html/atom 41 | # golang.org/x/sys v0.33.0 42 | ## explicit; go 1.23.0 43 | golang.org/x/sys/unix 44 | golang.org/x/sys/windows 45 | -------------------------------------------------------------------------------- /version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # Self-modifying script that updates the version numbers 4 | # Requires "setconf" 5 | # 6 | 7 | # The current version goes here, as the default value 8 | VERSION=${1:-'1.0.10'} 9 | 10 | if [ -z "$1" ]; then 11 | echo "The current version is $VERSION, pass the new version as the first argument if you wish to change it" 12 | exit 0 13 | fi 14 | 15 | echo "Setting the version to $VERSION" 16 | 17 | # Set the version in various files 18 | setconf README.md '* Version' $VERSION 19 | setconf main.go versionString "\"Desktop File Generator "$VERSION"\"" 20 | 21 | # Update the date and version in the man page 22 | d=$(LC_ALL=C date +'%d %b %Y') 23 | sed -i "s/\"[0-9]* [A-Z][a-z]* [0-9]*\"/\"$d\"/g" gendesk.1 24 | sed -i "s/[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/$VERSION/g" gendesk.1 25 | 26 | # Update the version in this script 27 | sed -i "s/[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/$VERSION/g" "$0" 28 | 29 | echo 'Also update the changelog in README.md' 30 | --------------------------------------------------------------------------------