├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── LICENCE ├── README.md ├── cmd └── facter │ └── main.go ├── go.mod ├── go.sum ├── lib ├── common │ ├── common.go │ └── common_test.go ├── cpu │ └── cpu.go ├── disk │ └── disk.go ├── facter │ ├── facter.go │ └── facter_test.go ├── formatter │ ├── json.go │ ├── keyvalue.go │ └── plaintext.go ├── host │ ├── host.go │ └── host_test.go ├── mem │ └── mem.go └── net │ └── net.go └── vendor ├── github.com ├── ebitengine │ └── purego │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── abi_amd64.h │ │ ├── abi_arm64.h │ │ ├── cgo.go │ │ ├── dlerror.go │ │ ├── dlfcn.go │ │ ├── dlfcn_android.go │ │ ├── dlfcn_darwin.go │ │ ├── dlfcn_freebsd.go │ │ ├── dlfcn_linux.go │ │ ├── dlfcn_nocgo_freebsd.go │ │ ├── dlfcn_nocgo_linux.go │ │ ├── dlfcn_playground.go │ │ ├── dlfcn_stubs.s │ │ ├── func.go │ │ ├── go_runtime.go │ │ ├── internal │ │ ├── cgo │ │ │ ├── dlfcn_cgo_unix.go │ │ │ ├── empty.go │ │ │ └── syscall_cgo_unix.go │ │ ├── fakecgo │ │ │ ├── abi_amd64.h │ │ │ ├── abi_arm64.h │ │ │ ├── asm_amd64.s │ │ │ ├── asm_arm64.s │ │ │ ├── callbacks.go │ │ │ ├── doc.go │ │ │ ├── freebsd.go │ │ │ ├── go_darwin_amd64.go │ │ │ ├── go_darwin_arm64.go │ │ │ ├── go_freebsd_amd64.go │ │ │ ├── go_freebsd_arm64.go │ │ │ ├── go_libinit.go │ │ │ ├── go_linux_amd64.go │ │ │ ├── go_linux_arm64.go │ │ │ ├── go_setenv.go │ │ │ ├── go_util.go │ │ │ ├── iscgo.go │ │ │ ├── libcgo.go │ │ │ ├── libcgo_darwin.go │ │ │ ├── libcgo_freebsd.go │ │ │ ├── libcgo_linux.go │ │ │ ├── setenv.go │ │ │ ├── symbols.go │ │ │ ├── symbols_darwin.go │ │ │ ├── symbols_freebsd.go │ │ │ ├── symbols_linux.go │ │ │ ├── trampolines_amd64.s │ │ │ ├── trampolines_arm64.s │ │ │ └── trampolines_stubs.s │ │ └── strings │ │ │ └── strings.go │ │ ├── is_ios.go │ │ ├── nocgo.go │ │ ├── struct_amd64.go │ │ ├── struct_arm64.go │ │ ├── struct_other.go │ │ ├── sys_amd64.s │ │ ├── sys_arm64.s │ │ ├── sys_unix_arm64.s │ │ ├── syscall.go │ │ ├── syscall_cgo_linux.go │ │ ├── syscall_sysv.go │ │ ├── syscall_windows.go │ │ ├── zcallback_amd64.s │ │ └── zcallback_arm64.s ├── go-ole │ └── go-ole │ │ ├── .travis.yml │ │ ├── ChangeLog.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── com.go │ │ ├── com_func.go │ │ ├── connect.go │ │ ├── constants.go │ │ ├── error.go │ │ ├── error_func.go │ │ ├── error_windows.go │ │ ├── guid.go │ │ ├── iconnectionpoint.go │ │ ├── iconnectionpoint_func.go │ │ ├── iconnectionpoint_windows.go │ │ ├── iconnectionpointcontainer.go │ │ ├── iconnectionpointcontainer_func.go │ │ ├── iconnectionpointcontainer_windows.go │ │ ├── idispatch.go │ │ ├── idispatch_func.go │ │ ├── idispatch_windows.go │ │ ├── ienumvariant.go │ │ ├── ienumvariant_func.go │ │ ├── ienumvariant_windows.go │ │ ├── iinspectable.go │ │ ├── iinspectable_func.go │ │ ├── iinspectable_windows.go │ │ ├── iprovideclassinfo.go │ │ ├── iprovideclassinfo_func.go │ │ ├── iprovideclassinfo_windows.go │ │ ├── itypeinfo.go │ │ ├── itypeinfo_func.go │ │ ├── itypeinfo_windows.go │ │ ├── iunknown.go │ │ ├── iunknown_func.go │ │ ├── iunknown_windows.go │ │ ├── ole.go │ │ ├── oleutil │ │ ├── connection.go │ │ ├── connection_func.go │ │ ├── connection_windows.go │ │ ├── go-get.go │ │ └── oleutil.go │ │ ├── safearray.go │ │ ├── safearray_func.go │ │ ├── safearray_windows.go │ │ ├── safearrayconversion.go │ │ ├── safearrayslices.go │ │ ├── utility.go │ │ ├── variables.go │ │ ├── variant.go │ │ ├── variant_386.go │ │ ├── variant_amd64.go │ │ ├── variant_arm.go │ │ ├── variant_arm64.go │ │ ├── variant_date_386.go │ │ ├── variant_date_amd64.go │ │ ├── variant_date_arm.go │ │ ├── variant_date_arm64.go │ │ ├── variant_ppc64le.go │ │ ├── variant_s390x.go │ │ ├── vt_string.go │ │ ├── winrt.go │ │ └── winrt_doc.go ├── lufia │ └── plan9stats │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cpu.go │ │ ├── doc.go │ │ ├── host.go │ │ ├── int.go │ │ ├── opts.go │ │ └── stats.go ├── power-devops │ └── perfstat │ │ ├── LICENSE │ │ ├── c_helpers.c │ │ ├── c_helpers.h │ │ ├── config.go │ │ ├── cpustat.go │ │ ├── diskstat.go │ │ ├── doc.go │ │ ├── fsstat.go │ │ ├── helpers.go │ │ ├── lparstat.go │ │ ├── lvmstat.go │ │ ├── memstat.go │ │ ├── netstat.go │ │ ├── procstat.go │ │ ├── sysconf.go │ │ ├── systemcfg.go │ │ ├── types_cpu.go │ │ ├── types_disk.go │ │ ├── types_fs.go │ │ ├── types_lpar.go │ │ ├── types_lvm.go │ │ ├── types_memory.go │ │ ├── types_network.go │ │ ├── types_process.go │ │ └── uptime.go ├── shirou │ └── gopsutil │ │ └── v4 │ │ ├── LICENSE │ │ ├── common │ │ └── env.go │ │ ├── cpu │ │ ├── cpu.go │ │ ├── cpu_aix.go │ │ ├── cpu_aix_cgo.go │ │ ├── cpu_aix_nocgo.go │ │ ├── cpu_darwin.go │ │ ├── cpu_darwin_arm64.go │ │ ├── cpu_darwin_fallback.go │ │ ├── cpu_dragonfly.go │ │ ├── cpu_dragonfly_amd64.go │ │ ├── cpu_fallback.go │ │ ├── cpu_freebsd.go │ │ ├── cpu_freebsd_386.go │ │ ├── cpu_freebsd_amd64.go │ │ ├── cpu_freebsd_arm.go │ │ ├── cpu_freebsd_arm64.go │ │ ├── cpu_linux.go │ │ ├── cpu_netbsd.go │ │ ├── cpu_netbsd_amd64.go │ │ ├── cpu_netbsd_arm.go │ │ ├── cpu_netbsd_arm64.go │ │ ├── cpu_openbsd.go │ │ ├── cpu_openbsd_386.go │ │ ├── cpu_openbsd_amd64.go │ │ ├── cpu_openbsd_arm.go │ │ ├── cpu_openbsd_arm64.go │ │ ├── cpu_openbsd_riscv64.go │ │ ├── cpu_plan9.go │ │ ├── cpu_solaris.go │ │ └── cpu_windows.go │ │ ├── disk │ │ ├── disk.go │ │ ├── disk_aix.go │ │ ├── disk_aix_cgo.go │ │ ├── disk_aix_nocgo.go │ │ ├── disk_darwin.go │ │ ├── disk_fallback.go │ │ ├── disk_freebsd.go │ │ ├── disk_freebsd_386.go │ │ ├── disk_freebsd_amd64.go │ │ ├── disk_freebsd_arm.go │ │ ├── disk_freebsd_arm64.go │ │ ├── disk_linux.go │ │ ├── disk_netbsd.go │ │ ├── disk_netbsd_amd64.go │ │ ├── disk_netbsd_arm.go │ │ ├── disk_netbsd_arm64.go │ │ ├── disk_openbsd.go │ │ ├── disk_openbsd_386.go │ │ ├── disk_openbsd_amd64.go │ │ ├── disk_openbsd_arm.go │ │ ├── disk_openbsd_arm64.go │ │ ├── disk_openbsd_riscv64.go │ │ ├── disk_solaris.go │ │ ├── disk_unix.go │ │ └── disk_windows.go │ │ ├── host │ │ ├── host.go │ │ ├── host_aix.go │ │ ├── host_aix_ppc64.go │ │ ├── host_bsd.go │ │ ├── host_darwin.go │ │ ├── host_darwin_amd64.go │ │ ├── host_darwin_arm64.go │ │ ├── host_fallback.go │ │ ├── host_freebsd.go │ │ ├── host_freebsd_386.go │ │ ├── host_freebsd_amd64.go │ │ ├── host_freebsd_arm.go │ │ ├── host_freebsd_arm64.go │ │ ├── host_linux.go │ │ ├── host_linux_386.go │ │ ├── host_linux_amd64.go │ │ ├── host_linux_arm.go │ │ ├── host_linux_arm64.go │ │ ├── host_linux_loong64.go │ │ ├── host_linux_mips.go │ │ ├── host_linux_mips64.go │ │ ├── host_linux_mips64le.go │ │ ├── host_linux_mipsle.go │ │ ├── host_linux_ppc64.go │ │ ├── host_linux_ppc64le.go │ │ ├── host_linux_riscv64.go │ │ ├── host_linux_s390x.go │ │ ├── host_netbsd.go │ │ ├── host_openbsd.go │ │ ├── host_openbsd_386.go │ │ ├── host_openbsd_amd64.go │ │ ├── host_openbsd_arm.go │ │ ├── host_openbsd_arm64.go │ │ ├── host_openbsd_riscv64.go │ │ ├── host_posix.go │ │ ├── host_solaris.go │ │ └── host_windows.go │ │ ├── internal │ │ └── common │ │ │ ├── common.go │ │ │ ├── common_darwin.go │ │ │ ├── common_freebsd.go │ │ │ ├── common_linux.go │ │ │ ├── common_netbsd.go │ │ │ ├── common_openbsd.go │ │ │ ├── common_unix.go │ │ │ ├── common_windows.go │ │ │ ├── endian.go │ │ │ ├── readlink_linux.go │ │ │ ├── sleep.go │ │ │ └── warnings.go │ │ ├── mem │ │ ├── ex_linux.go │ │ ├── ex_windows.go │ │ ├── mem.go │ │ ├── mem_aix.go │ │ ├── mem_aix_cgo.go │ │ ├── mem_aix_nocgo.go │ │ ├── mem_bsd.go │ │ ├── mem_darwin.go │ │ ├── mem_fallback.go │ │ ├── mem_freebsd.go │ │ ├── mem_linux.go │ │ ├── mem_netbsd.go │ │ ├── mem_openbsd.go │ │ ├── mem_openbsd_386.go │ │ ├── mem_openbsd_amd64.go │ │ ├── mem_openbsd_arm.go │ │ ├── mem_openbsd_arm64.go │ │ ├── mem_openbsd_riscv64.go │ │ ├── mem_plan9.go │ │ ├── mem_solaris.go │ │ └── mem_windows.go │ │ ├── net │ │ ├── net.go │ │ ├── net_aix.go │ │ ├── net_aix_cgo.go │ │ ├── net_aix_nocgo.go │ │ ├── net_darwin.go │ │ ├── net_fallback.go │ │ ├── net_freebsd.go │ │ ├── net_linux.go │ │ ├── net_openbsd.go │ │ ├── net_solaris.go │ │ ├── net_unix.go │ │ └── net_windows.go │ │ └── process │ │ ├── process.go │ │ ├── process_bsd.go │ │ ├── process_darwin.go │ │ ├── process_darwin_amd64.go │ │ ├── process_darwin_arm64.go │ │ ├── process_fallback.go │ │ ├── process_freebsd.go │ │ ├── process_freebsd_386.go │ │ ├── process_freebsd_amd64.go │ │ ├── process_freebsd_arm.go │ │ ├── process_freebsd_arm64.go │ │ ├── process_linux.go │ │ ├── process_openbsd.go │ │ ├── process_openbsd_386.go │ │ ├── process_openbsd_amd64.go │ │ ├── process_openbsd_arm.go │ │ ├── process_openbsd_arm64.go │ │ ├── process_openbsd_riscv64.go │ │ ├── process_plan9.go │ │ ├── process_posix.go │ │ ├── process_solaris.go │ │ ├── process_windows.go │ │ ├── process_windows_32bit.go │ │ └── process_windows_64bit.go ├── tklauser │ ├── go-sysconf │ │ ├── .cirrus.yml │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── sysconf.go │ │ ├── sysconf_bsd.go │ │ ├── sysconf_darwin.go │ │ ├── sysconf_dragonfly.go │ │ ├── sysconf_freebsd.go │ │ ├── sysconf_generic.go │ │ ├── sysconf_linux.go │ │ ├── sysconf_netbsd.go │ │ ├── sysconf_openbsd.go │ │ ├── sysconf_posix.go │ │ ├── sysconf_solaris.go │ │ ├── sysconf_unsupported.go │ │ ├── zsysconf_defs_darwin.go │ │ ├── zsysconf_defs_dragonfly.go │ │ ├── zsysconf_defs_freebsd.go │ │ ├── zsysconf_defs_linux.go │ │ ├── zsysconf_defs_netbsd.go │ │ ├── zsysconf_defs_openbsd.go │ │ ├── zsysconf_defs_solaris.go │ │ ├── zsysconf_values_freebsd_386.go │ │ ├── zsysconf_values_freebsd_amd64.go │ │ ├── zsysconf_values_freebsd_arm.go │ │ ├── zsysconf_values_freebsd_arm64.go │ │ ├── zsysconf_values_freebsd_riscv64.go │ │ ├── zsysconf_values_linux_386.go │ │ ├── zsysconf_values_linux_amd64.go │ │ ├── zsysconf_values_linux_arm.go │ │ ├── zsysconf_values_linux_arm64.go │ │ ├── zsysconf_values_linux_loong64.go │ │ ├── zsysconf_values_linux_mips.go │ │ ├── zsysconf_values_linux_mips64.go │ │ ├── zsysconf_values_linux_mips64le.go │ │ ├── zsysconf_values_linux_mipsle.go │ │ ├── zsysconf_values_linux_ppc64.go │ │ ├── zsysconf_values_linux_ppc64le.go │ │ ├── zsysconf_values_linux_riscv64.go │ │ ├── zsysconf_values_linux_s390x.go │ │ ├── zsysconf_values_netbsd_386.go │ │ ├── zsysconf_values_netbsd_amd64.go │ │ ├── zsysconf_values_netbsd_arm.go │ │ └── zsysconf_values_netbsd_arm64.go │ └── numcpus │ │ ├── .cirrus.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── numcpus.go │ │ ├── numcpus_bsd.go │ │ ├── numcpus_linux.go │ │ ├── numcpus_list_unsupported.go │ │ ├── numcpus_solaris.go │ │ ├── numcpus_unsupported.go │ │ └── numcpus_windows.go └── yusufpapurcu │ └── wmi │ ├── LICENSE │ ├── README.md │ ├── swbemservices.go │ └── wmi.go ├── golang.org └── x │ └── 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 │ ├── registry │ ├── key.go │ ├── mksyscall.go │ ├── syscall.go │ ├── value.go │ └── zsyscall_windows.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 /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "monthly" 8 | groups: 9 | minor-actions-dependencies: 10 | # GitHub Actions: Only group minor and patch updates 11 | update-types: [minor, patch] 12 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: CI for go-facter 3 | 4 | on: [push] # yamllint disable-line rule:truthy 5 | 6 | jobs: 7 | build: 8 | 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | go-version: ["1.24"] 13 | 14 | steps: 15 | - name: Checkout repository 16 | uses: actions/checkout@v5 17 | - name: Setup Go 18 | uses: actions/setup-go@v6 19 | with: 20 | go-version: ${{ matrix.go-version }} 21 | - name: Test with Go 22 | run: go test -json -v ./... > TestResults-${{ matrix.go-version }}.json 23 | - name: Upload Go test results 24 | uses: actions/upload-artifact@v5 25 | with: 26 | name: Go-results-${{ matrix.go-version }} 27 | path: TestResults-${{ matrix.go-version }}.json 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # go-facter 2 | 3 | go-facter is a loose implementation of Puppet Labs [facter] in golang. The main target are platforms where there isn't possible or feasible to install Ruby, eg. [CoreOS]. Also, you can run it in Docker Container and still get data from the Host itself. 4 | 5 | In theory, go-facter can be used as a library of sort to build custom facts. 6 | 7 | ## Licence 8 | 9 | BSD 3-Clause ("BSD New" or "BSD Simplified") licence. 10 | 11 | ## Environment variables 12 | 13 | * `HOST_ETC` - specify alternative path to `/etc` directory 14 | * `HOST_PROC` - specify alternative path to `/proc` mountpoint 15 | * `HOST_SYS` - specify alternative path to `/sys` mountpoint 16 | 17 | ## Requirements 18 | 19 | - go v1.24.0 or newer is required 20 | 21 | ## Build 22 | 23 | ``` 24 | go get github.com/zstyblik/go-facter/... 25 | cd ~/go/src/github.com/zstyblik/go-facter 26 | go test -v ./... 27 | go build ./cmd/facter 28 | ``` 29 | 30 | [facter]: 31 | [CoreOS]: 32 | -------------------------------------------------------------------------------- /cmd/facter/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | 6 | "github.com/zstyblik/go-facter/lib/cpu" 7 | "github.com/zstyblik/go-facter/lib/disk" 8 | "github.com/zstyblik/go-facter/lib/facter" 9 | "github.com/zstyblik/go-facter/lib/formatter" 10 | "github.com/zstyblik/go-facter/lib/host" 11 | "github.com/zstyblik/go-facter/lib/mem" 12 | "github.com/zstyblik/go-facter/lib/net" 13 | ) 14 | 15 | func main() { 16 | conf := facter.Config{} 17 | ptFormat := flag.Bool("plaintext", false, 18 | "Emit facts as key => value pairs") 19 | kvFormat := flag.Bool("keyvalue", false, 20 | "Emit facts as key:value pairs") 21 | jsonFormat := flag.Bool("json", false, 22 | "Emit facts as a JSON") 23 | flag.Parse() 24 | 25 | if *ptFormat == true { 26 | conf.Formatter = formatter.NewFormatter() 27 | } else if *kvFormat == true { 28 | conf.Formatter = formatter.NewKeyValueFormatter() 29 | } else if *jsonFormat == true { 30 | conf.Formatter = formatter.NewJSONFormatter() 31 | } else { 32 | conf.Formatter = formatter.NewFormatter() 33 | } 34 | 35 | facter := facter.New(&conf) 36 | _ = cpu.GetCPUFacts(facter) 37 | _ = disk.GetDiskFacts(facter) 38 | _ = host.GetHostFacts(facter) 39 | _ = mem.GetMemoryFacts(facter) 40 | _ = net.GetNetFacts(facter) 41 | facter.Print() 42 | } 43 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/zstyblik/go-facter 2 | 3 | go 1.24.0 4 | 5 | require ( 6 | github.com/shirou/gopsutil/v4 v4.25.8 7 | golang.org/x/sys v0.36.0 8 | ) 9 | 10 | require ( 11 | github.com/ebitengine/purego v0.8.4 // indirect 12 | github.com/go-ole/go-ole v1.2.6 // indirect 13 | github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect 14 | github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect 15 | github.com/tklauser/go-sysconf v0.3.15 // indirect 16 | github.com/tklauser/numcpus v0.10.0 // indirect 17 | github.com/yusufpapurcu/wmi v1.2.4 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /lib/cpu/cpu.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | 7 | c "github.com/shirou/gopsutil/v4/cpu" 8 | ) 9 | 10 | // Facter interface 11 | type Facter interface { 12 | Add(string, interface{}) 13 | } 14 | 15 | // GetCPUFacts gathers facts related to CPU 16 | func GetCPUFacts(f Facter) error { 17 | totalCount, err := c.Counts(true) 18 | if err != nil { 19 | return err 20 | } 21 | f.Add("processorcount", totalCount) 22 | 23 | CPUs, err := c.Info() 24 | if err != nil { 25 | return err 26 | } 27 | physIDs := make(map[uint64]struct{}) 28 | for _, v := range CPUs { 29 | physID, err := strconv.ParseUint(v.PhysicalID, 10, 32) 30 | if err == nil { 31 | physIDs[physID] = struct{}{} 32 | } 33 | f.Add(fmt.Sprintf("processor%v", v.CPU), v.ModelName) 34 | } 35 | f.Add("physicalprocessorcount", len(physIDs)) 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /lib/facter/facter.go: -------------------------------------------------------------------------------- 1 | package facter 2 | 3 | import ( 4 | "github.com/zstyblik/go-facter/lib/formatter" 5 | ) 6 | 7 | // Facter struct holds Facter-related attributes 8 | type Facter struct { 9 | facts map[string]interface{} 10 | formatter Formatter 11 | } 12 | 13 | // Config struct serves to pass Facter configuration 14 | type Config struct { 15 | Formatter Formatter 16 | } 17 | 18 | // Formatter interface 19 | type Formatter interface { 20 | Print(map[string]interface{}) error 21 | } 22 | 23 | // New returns new instance of Facter 24 | func New(userConf *Config) *Facter { 25 | var conf *Config 26 | if userConf != nil { 27 | conf = userConf 28 | } else { 29 | conf = &Config{ 30 | Formatter: formatter.NewFormatter(), 31 | } 32 | } 33 | f := &Facter{ 34 | facts: make(map[string]interface{}), 35 | formatter: conf.Formatter, 36 | } 37 | return f 38 | } 39 | 40 | // Add adds a fact 41 | func (f *Facter) Add(k string, v interface{}) { 42 | f.facts[k] = v 43 | } 44 | 45 | // Delete deletes given fact 46 | func (f *Facter) Delete(k string) { 47 | delete(f.facts, k) 48 | } 49 | 50 | // Get returns value of given fact, if it exists 51 | func (f *Facter) Get(k string) (interface{}, bool) { 52 | value, ok := f.facts[k] 53 | return value, ok 54 | } 55 | 56 | // Print prints-out facts by calling formatter 57 | func (f *Facter) Print() { 58 | f.formatter.Print(f.facts) 59 | } 60 | -------------------------------------------------------------------------------- /lib/formatter/json.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | j "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | // JSONFormatter prints-out facts in JSON format 9 | type JSONFormatter struct { 10 | } 11 | 12 | // NewJSONFormatter returns new JSON formatter 13 | func NewJSONFormatter() *JSONFormatter { 14 | return &JSONFormatter{} 15 | } 16 | 17 | // Print prints-out facts in JSON format 18 | func (jf *JSONFormatter) Print(facts map[string]interface{}) error { 19 | b, err := j.MarshalIndent(facts, "", " ") 20 | if err != nil { 21 | return err 22 | } 23 | fmt.Printf("%s\n", b) 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /lib/formatter/keyvalue.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | ) 7 | 8 | // KeyValueFormatter prints-out facts in k:v format 9 | type KeyValueFormatter struct { 10 | } 11 | 12 | // NewKeyValueFormatter returns new key-value formatter 13 | func NewKeyValueFormatter() *KeyValueFormatter { 14 | return &KeyValueFormatter{} 15 | } 16 | 17 | // Print prints-out facts in k:v format 18 | func (kvf KeyValueFormatter) Print(facts map[string]interface{}) error { 19 | var keys []string 20 | for k := range facts { 21 | keys = append(keys, k) 22 | } 23 | sort.Strings(keys) 24 | for _, k := range keys { 25 | fmt.Printf("%v: %v\n", k, facts[k]) 26 | } 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /lib/formatter/plaintext.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | ) 7 | 8 | // PlainTextFormatter prints-out facts in k=>v format 9 | type PlainTextFormatter struct { 10 | } 11 | 12 | // NewFormatter returns new plain-text formatter 13 | func NewFormatter() *PlainTextFormatter { 14 | return &PlainTextFormatter{} 15 | } 16 | 17 | // Print prints-out facts in k=>v format 18 | func (pf PlainTextFormatter) Print(facts map[string]interface{}) error { 19 | var keys []string 20 | for k := range facts { 21 | keys = append(keys, k) 22 | } 23 | sort.Strings(keys) 24 | for _, k := range keys { 25 | fmt.Printf("%v => %v\n", k, facts[k]) 26 | } 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /lib/host/host_test.go: -------------------------------------------------------------------------------- 1 | package host 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | ) 7 | 8 | type capitalizeTPair struct { 9 | in string 10 | out string 11 | } 12 | 13 | func TestCapitalize(t *testing.T) { 14 | testPairs := []capitalizeTPair{ 15 | {"foo", "Foo"}, 16 | {"foo bar", "Foo bar"}, 17 | {"", ""}, 18 | {"Bar", "Bar"}, 19 | } 20 | for _, testPair := range testPairs { 21 | out := capitalize(testPair.in) 22 | t.Logf("input: '%v'; out:'%v'; exp: '%v'", testPair.in, out, 23 | testPair.out) 24 | if strings.Compare(out, testPair.out) != 0 { 25 | t.Error() 26 | } 27 | } 28 | } 29 | 30 | type garchTPair struct { 31 | in string 32 | out string 33 | } 34 | 35 | func TestGuessArch(t *testing.T) { 36 | testPairs := []garchTPair{ 37 | {"x86_64", "amd64"}, 38 | {"foo", "unknown"}, 39 | {"", "unknown"}, 40 | } 41 | for _, testPair := range testPairs { 42 | out := guessArch(testPair.in) 43 | t.Logf("input: '%v'; out:'%v'; exp: '%v'", testPair.in, out, 44 | testPair.out) 45 | if strings.Compare(out, testPair.out) != 0 { 46 | t.Error() 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/cgo.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 3 | 4 | //go:build cgo && (darwin || freebsd || linux) 5 | 6 | package purego 7 | 8 | // if CGO_ENABLED=1 import the Cgo runtime to ensure that it is set up properly. 9 | // This is required since some frameworks need TLS setup the C way which Go doesn't do. 10 | // We currently don't support ios in fakecgo mode so force Cgo or fail 11 | // Even if CGO_ENABLED=1 the Cgo runtime is not imported unless `import "C"` is used. 12 | // which will import this package automatically. Normally this isn't an issue since it 13 | // usually isn't possible to call into C without using that import. However, with purego 14 | // it is since we don't use `import "C"`! 15 | import ( 16 | _ "runtime/cgo" 17 | 18 | _ "github.com/ebitengine/purego/internal/cgo" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/dlerror.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2023 The Ebitengine Authors 3 | 4 | //go:build darwin || freebsd || linux 5 | 6 | package purego 7 | 8 | // Dlerror represents an error value returned from Dlopen, Dlsym, or Dlclose. 9 | // 10 | // This type is not available on Windows as there is no counterpart to it on Windows. 11 | type Dlerror struct { 12 | s string 13 | } 14 | 15 | func (e Dlerror) Error() string { 16 | return e.s 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/dlfcn_android.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors 3 | 4 | package purego 5 | 6 | import "github.com/ebitengine/purego/internal/cgo" 7 | 8 | // Source for constants: https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/dlfcn.h 9 | 10 | const ( 11 | is64bit = 1 << (^uintptr(0) >> 63) / 2 12 | is32bit = 1 - is64bit 13 | RTLD_DEFAULT = is32bit * 0xffffffff 14 | RTLD_LAZY = 0x00000001 15 | RTLD_NOW = is64bit * 0x00000002 16 | RTLD_LOCAL = 0x00000000 17 | RTLD_GLOBAL = is64bit*0x00100 | is32bit*0x00000002 18 | ) 19 | 20 | func Dlopen(path string, mode int) (uintptr, error) { 21 | return cgo.Dlopen(path, mode) 22 | } 23 | 24 | func Dlsym(handle uintptr, name string) (uintptr, error) { 25 | return cgo.Dlsym(handle, name) 26 | } 27 | 28 | func Dlclose(handle uintptr) error { 29 | return cgo.Dlclose(handle) 30 | } 31 | 32 | func loadSymbol(handle uintptr, name string) (uintptr, error) { 33 | return Dlsym(handle, name) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/dlfcn_darwin.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 3 | 4 | package purego 5 | 6 | // Source for constants: https://opensource.apple.com/source/dyld/dyld-360.14/include/dlfcn.h.auto.html 7 | 8 | const ( 9 | RTLD_DEFAULT = 1<<64 - 2 // Pseudo-handle for dlsym so search for any loaded symbol 10 | RTLD_LAZY = 0x1 // Relocations are performed at an implementation-dependent time. 11 | RTLD_NOW = 0x2 // Relocations are performed when the object is loaded. 12 | RTLD_LOCAL = 0x4 // All symbols are not made available for relocation processing by other modules. 13 | RTLD_GLOBAL = 0x8 // All symbols are available for relocation processing of other modules. 14 | ) 15 | 16 | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" 17 | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" 18 | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" 19 | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" 20 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/dlfcn_freebsd.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 3 | 4 | package purego 5 | 6 | // Constants as defined in https://github.com/freebsd/freebsd-src/blob/main/include/dlfcn.h 7 | const ( 8 | intSize = 32 << (^uint(0) >> 63) // 32 or 64 9 | RTLD_DEFAULT = 1<= len(suffix) && s[len(s)-len(suffix):] == suffix 13 | } 14 | 15 | // CString converts a go string to *byte that can be passed to C code. 16 | func CString(name string) *byte { 17 | if hasSuffix(name, "\x00") { 18 | return &(*(*[]byte)(unsafe.Pointer(&name)))[0] 19 | } 20 | b := make([]byte, len(name)+1) 21 | copy(b, name) 22 | return &b[0] 23 | } 24 | 25 | // GoString copies a null-terminated char* to a Go string. 26 | func GoString(c uintptr) string { 27 | // We take the address and then dereference it to trick go vet from creating a possible misuse of unsafe.Pointer 28 | ptr := *(*unsafe.Pointer)(unsafe.Pointer(&c)) 29 | if ptr == nil { 30 | return "" 31 | } 32 | var length int 33 | for { 34 | if *(*byte)(unsafe.Add(ptr, uintptr(length))) == '\x00' { 35 | break 36 | } 37 | length++ 38 | } 39 | return string(unsafe.Slice((*byte)(ptr), length)) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/is_ios.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 3 | 4 | //go:build !cgo 5 | 6 | package purego 7 | 8 | // if you are getting this error it means that you have 9 | // CGO_ENABLED=0 while trying to build for ios. 10 | // purego does not support this mode yet. 11 | // the fix is to set CGO_ENABLED=1 which will require 12 | // a C compiler. 13 | var _ = _PUREGO_REQUIRES_CGO_ON_IOS 14 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/nocgo.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 3 | 4 | //go:build !cgo && (darwin || freebsd || linux) 5 | 6 | package purego 7 | 8 | // if CGO_ENABLED=0 import fakecgo to setup the Cgo runtime correctly. 9 | // This is required since some frameworks need TLS setup the C way which Go doesn't do. 10 | // We currently don't support ios in fakecgo mode so force Cgo or fail 11 | // 12 | // The way that the Cgo runtime (runtime/cgo) works is by setting some variables found 13 | // in runtime with non-null GCC compiled functions. The variables that are replaced are 14 | // var ( 15 | // iscgo bool // in runtime/cgo.go 16 | // _cgo_init unsafe.Pointer // in runtime/cgo.go 17 | // _cgo_thread_start unsafe.Pointer // in runtime/cgo.go 18 | // _cgo_notify_runtime_init_done unsafe.Pointer // in runtime/cgo.go 19 | // _cgo_setenv unsafe.Pointer // in runtime/env_posix.go 20 | // _cgo_unsetenv unsafe.Pointer // in runtime/env_posix.go 21 | // ) 22 | // importing fakecgo will set these (using //go:linkname) with functions written 23 | // entirely in Go (except for some assembly trampolines to change GCC ABI to Go ABI). 24 | // Doing so makes it possible to build applications that call into C without CGO_ENABLED=1. 25 | import _ "github.com/ebitengine/purego/internal/fakecgo" 26 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/struct_other.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors 3 | 4 | //go:build !amd64 && !arm64 5 | 6 | package purego 7 | 8 | import "reflect" 9 | 10 | func addStruct(v reflect.Value, numInts, numFloats, numStack *int, addInt, addFloat, addStack func(uintptr), keepAlive []interface{}) []interface{} { 11 | panic("purego: struct arguments are not supported") 12 | } 13 | 14 | func getStruct(outType reflect.Type, syscall syscall15Args) (v reflect.Value) { 15 | panic("purego: struct returns are not supported") 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/ebitengine/purego/syscall_cgo_linux.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors 3 | 4 | //go:build cgo && !(amd64 || arm64) 5 | 6 | package purego 7 | 8 | import ( 9 | "github.com/ebitengine/purego/internal/cgo" 10 | ) 11 | 12 | var syscall15XABI0 = uintptr(cgo.Syscall15XABI0) 13 | 14 | //go:nosplit 15 | func syscall_syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2, err uintptr) { 16 | return cgo.Syscall15X(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) 17 | } 18 | 19 | func NewCallback(_ interface{}) uintptr { 20 | panic("purego: NewCallback on Linux is only supported on amd64/arm64") 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.9.x 6 | - 1.10.x 7 | - 1.11.x 8 | - tip 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2013-2017 Yasuhiro Matsumoto, 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the “Software”), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | 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/go-ole/go-ole/error_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // errstr converts error code to string. 6 | func errstr(errno int) string { 7 | return "" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unicode/utf16" 9 | ) 10 | 11 | // errstr converts error code to string. 12 | func errstr(errno int) string { 13 | // ask windows for the remaining errors 14 | var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS 15 | b := make([]uint16, 300) 16 | n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) 17 | if err != nil { 18 | return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) 19 | } 20 | // trim terminating \r and \n 21 | for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { 22 | } 23 | return string(utf16.Decode(b[:n])) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPoint struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointVtbl struct { 10 | IUnknownVtbl 11 | GetConnectionInterface uintptr 12 | GetConnectionPointContainer uintptr 13 | Advise uintptr 14 | Unadvise uintptr 15 | EnumConnections uintptr 16 | } 17 | 18 | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { 19 | return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | import "unsafe" 6 | 7 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 8 | return int32(0) 9 | } 10 | 11 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { 12 | return uint32(0), NewError(E_NOTIMPL) 13 | } 14 | 15 | func (v *IConnectionPoint) Unadvise(cookie uint32) error { 16 | return NewError(E_NOTIMPL) 17 | } 18 | 19 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { 20 | return NewError(E_NOTIMPL) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 11 | // XXX: This doesn't look like it does what it's supposed to 12 | return release((*IUnknown)(unsafe.Pointer(v))) 13 | } 14 | 15 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (cookie uint32, err error) { 16 | hr, _, _ := syscall.Syscall( 17 | v.VTable().Advise, 18 | 3, 19 | uintptr(unsafe.Pointer(v)), 20 | uintptr(unsafe.Pointer(unknown)), 21 | uintptr(unsafe.Pointer(&cookie))) 22 | if hr != 0 { 23 | err = NewError(hr) 24 | } 25 | return 26 | } 27 | 28 | func (v *IConnectionPoint) Unadvise(cookie uint32) (err error) { 29 | hr, _, _ := syscall.Syscall( 30 | v.VTable().Unadvise, 31 | 2, 32 | uintptr(unsafe.Pointer(v)), 33 | uintptr(cookie), 34 | 0) 35 | if hr != 0 { 36 | err = NewError(hr) 37 | } 38 | return 39 | } 40 | 41 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) error { 42 | return NewError(E_NOTIMPL) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPointContainer struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointContainerVtbl struct { 10 | IUnknownVtbl 11 | EnumConnectionPoints uintptr 12 | FindConnectionPoint uintptr 13 | } 14 | 15 | func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { 16 | return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 11 | return NewError(E_NOTIMPL) 12 | } 13 | 14 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { 15 | hr, _, _ := syscall.Syscall( 16 | v.VTable().FindConnectionPoint, 17 | 3, 18 | uintptr(unsafe.Pointer(v)), 19 | uintptr(unsafe.Pointer(iid)), 20 | uintptr(unsafe.Pointer(point))) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/idispatch_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { 6 | return []int32{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func getTypeInfoCount(disp *IDispatch) (uint32, error) { 10 | return uint32(0), NewError(E_NOTIMPL) 11 | } 12 | 13 | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { 14 | return nil, NewError(E_NOTIMPL) 15 | } 16 | 17 | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { 18 | return nil, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IEnumVARIANT struct { 6 | IUnknown 7 | } 8 | 9 | type IEnumVARIANTVtbl struct { 10 | IUnknownVtbl 11 | Next uintptr 12 | Skip uintptr 13 | Reset uintptr 14 | Clone uintptr 15 | } 16 | 17 | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { 18 | return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (enum *IEnumVARIANT) Reset() error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | 13 | func (enum *IEnumVARIANT) Skip(celt uint) error { 14 | return NewError(E_NOTIMPL) 15 | } 16 | 17 | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { 18 | return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | enum.VTable().Clone, 13 | 2, 14 | uintptr(unsafe.Pointer(enum)), 15 | uintptr(unsafe.Pointer(&cloned)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | 23 | func (enum *IEnumVARIANT) Reset() (err error) { 24 | hr, _, _ := syscall.Syscall( 25 | enum.VTable().Reset, 26 | 1, 27 | uintptr(unsafe.Pointer(enum)), 28 | 0, 29 | 0) 30 | if hr != 0 { 31 | err = NewError(hr) 32 | } 33 | return 34 | } 35 | 36 | func (enum *IEnumVARIANT) Skip(celt uint) (err error) { 37 | hr, _, _ := syscall.Syscall( 38 | enum.VTable().Skip, 39 | 2, 40 | uintptr(unsafe.Pointer(enum)), 41 | uintptr(celt), 42 | 0) 43 | if hr != 0 { 44 | err = NewError(hr) 45 | } 46 | return 47 | } 48 | 49 | func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, err error) { 50 | hr, _, _ := syscall.Syscall6( 51 | enum.VTable().Next, 52 | 4, 53 | uintptr(unsafe.Pointer(enum)), 54 | uintptr(celt), 55 | uintptr(unsafe.Pointer(&array)), 56 | uintptr(unsafe.Pointer(&length)), 57 | 0, 58 | 0) 59 | if hr != 0 { 60 | err = NewError(hr) 61 | } 62 | return 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IInspectable struct { 6 | IUnknown 7 | } 8 | 9 | type IInspectableVtbl struct { 10 | IUnknownVtbl 11 | GetIIds uintptr 12 | GetRuntimeClassName uintptr 13 | GetTrustLevel uintptr 14 | } 15 | 16 | func (v *IInspectable) VTable() *IInspectableVtbl { 17 | return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IInspectable) GetIids() ([]*GUID, error) { 6 | return []*GUID{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IInspectable) GetRuntimeClassName() (string, error) { 10 | return "", NewError(E_NOTIMPL) 11 | } 12 | 13 | func (v *IInspectable) GetTrustLevel() (uint32, error) { 14 | return uint32(0), NewError(E_NOTIMPL) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IProvideClassInfo struct { 6 | IUnknown 7 | } 8 | 9 | type IProvideClassInfoVtbl struct { 10 | IUnknownVtbl 11 | GetClassInfo uintptr 12 | } 13 | 14 | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { 15 | return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) 16 | } 17 | 18 | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { 19 | cinfo, err = getClassInfo(v) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | disp.VTable().GetClassInfo, 13 | 2, 14 | uintptr(unsafe.Pointer(disp)), 15 | uintptr(unsafe.Pointer(&tinfo)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type ITypeInfo struct { 6 | IUnknown 7 | } 8 | 9 | type ITypeInfoVtbl struct { 10 | IUnknownVtbl 11 | GetTypeAttr uintptr 12 | GetTypeComp uintptr 13 | GetFuncDesc uintptr 14 | GetVarDesc uintptr 15 | GetNames uintptr 16 | GetRefTypeOfImplType uintptr 17 | GetImplTypeFlags uintptr 18 | GetIDsOfNames uintptr 19 | Invoke uintptr 20 | GetDocumentation uintptr 21 | GetDllEntry uintptr 22 | GetRefTypeInfo uintptr 23 | AddressOfMember uintptr 24 | CreateInstance uintptr 25 | GetMops uintptr 26 | GetContainingTypeLib uintptr 27 | ReleaseTypeAttr uintptr 28 | ReleaseFuncDesc uintptr 29 | ReleaseVarDesc uintptr 30 | } 31 | 32 | func (v *ITypeInfo) VTable() *ITypeInfoVtbl { 33 | return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | uintptr(v.VTable().GetTypeAttr), 13 | 2, 14 | uintptr(unsafe.Pointer(v)), 15 | uintptr(unsafe.Pointer(&tattr)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 10 | return nil, NewError(E_NOTIMPL) 11 | } 12 | 13 | func addRef(unk *IUnknown) int32 { 14 | return 0 15 | } 16 | 17 | func release(unk *IUnknown) int32 { 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "reflect" 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 12 | selfValue := reflect.ValueOf(self).Elem() 13 | objValue := reflect.ValueOf(obj).Elem() 14 | 15 | hr, _, _ := syscall.Syscall( 16 | method, 17 | 3, 18 | selfValue.UnsafeAddr(), 19 | uintptr(unsafe.Pointer(interfaceID)), 20 | objValue.Addr().Pointer()) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | 27 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 28 | hr, _, _ := syscall.Syscall( 29 | unk.VTable().QueryInterface, 30 | 3, 31 | uintptr(unsafe.Pointer(unk)), 32 | uintptr(unsafe.Pointer(iid)), 33 | uintptr(unsafe.Pointer(&disp))) 34 | if hr != 0 { 35 | err = NewError(hr) 36 | } 37 | return 38 | } 39 | 40 | func addRef(unk *IUnknown) int32 { 41 | ret, _, _ := syscall.Syscall( 42 | unk.VTable().AddRef, 43 | 1, 44 | uintptr(unsafe.Pointer(unk)), 45 | 0, 46 | 0) 47 | return int32(ret) 48 | } 49 | 50 | func release(unk *IUnknown) int32 { 51 | ret, _, _ := syscall.Syscall( 52 | unk.VTable().Release, 53 | 1, 54 | uintptr(unsafe.Pointer(unk)), 55 | 0, 56 | 0) 57 | return int32(ret) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/connection_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package oleutil 4 | 5 | import ole "github.com/go-ole/go-ole" 6 | 7 | // ConnectObject creates a connection point between two services for communication. 8 | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { 9 | return 0, ole.NewError(ole.E_NOTIMPL) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/go-get.go: -------------------------------------------------------------------------------- 1 | // This file is here so go get succeeds as without it errors with: 2 | // no buildable Go source files in ... 3 | // 4 | // +build !windows 5 | 6 | package oleutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearray.go: -------------------------------------------------------------------------------- 1 | // Package is meant to retrieve and process safe array data returned from COM. 2 | 3 | package ole 4 | 5 | // SafeArrayBound defines the SafeArray boundaries. 6 | type SafeArrayBound struct { 7 | Elements uint32 8 | LowerBound int32 9 | } 10 | 11 | // SafeArray is how COM handles arrays. 12 | type SafeArray struct { 13 | Dimensions uint16 14 | FeaturesFlag uint16 15 | ElementsSize uint32 16 | LocksAmount uint32 17 | Data uint32 18 | Bounds [16]byte 19 | } 20 | 21 | // SAFEARRAY is obsolete, exists for backwards compatibility. 22 | // Use SafeArray 23 | type SAFEARRAY SafeArray 24 | 25 | // SAFEARRAYBOUND is obsolete, exists for backwards compatibility. 26 | // Use SafeArrayBound 27 | type SAFEARRAYBOUND SafeArrayBound 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearrayslices.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func safeArrayFromByteSlice(slice []byte) *SafeArray { 10 | array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) 11 | 12 | if array == nil { 13 | panic("Could not convert []byte to SAFEARRAY") 14 | } 15 | 16 | for i, v := range slice { 17 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) 18 | } 19 | return array 20 | } 21 | 22 | func safeArrayFromStringSlice(slice []string) *SafeArray { 23 | array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) 24 | 25 | if array == nil { 26 | panic("Could not convert []string to SAFEARRAY") 27 | } 28 | // SysAllocStringLen(s) 29 | for i, v := range slice { 30 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) 31 | } 32 | return array 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variables.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | var ( 10 | modcombase = windows.NewLazySystemDLL("combase.dll") 11 | modkernel32 = windows.NewLazySystemDLL("kernel32.dll") 12 | modole32 = windows.NewLazySystemDLL("ole32.dll") 13 | modoleaut32 = windows.NewLazySystemDLL("oleaut32.dll") 14 | moduser32 = windows.NewLazySystemDLL("user32.dll") 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_386.go: -------------------------------------------------------------------------------- 1 | // +build 386 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_amd64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_arm.go: -------------------------------------------------------------------------------- 1 | // +build arm 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build arm64 2 | // +build arm64 3 | 4 | package ole 5 | 6 | type VARIANT struct { 7 | VT VT // 2 8 | wReserved1 uint16 // 4 9 | wReserved2 uint16 // 6 10 | wReserved3 uint16 // 8 11 | Val int64 // 16 12 | _ [8]byte // 24 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_386.go: -------------------------------------------------------------------------------- 1 | // +build windows,386 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | v1 := uint32(value) 16 | v2 := uint32(value >> 32) 17 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 18 | if r != 0 { 19 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 20 | } 21 | return time.Now(), errors.New("Could not convert to time, passing current time.") 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_amd64.go: -------------------------------------------------------------------------------- 1 | // +build windows,amd64 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st))) 16 | if r != 0 { 17 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 18 | } 19 | return time.Now(), errors.New("Could not convert to time, passing current time.") 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_arm.go: -------------------------------------------------------------------------------- 1 | // +build windows,arm 2 | 3 | package ole 4 | 5 | import ( 6 | "errors" 7 | "syscall" 8 | "time" 9 | "unsafe" 10 | ) 11 | 12 | // GetVariantDate converts COM Variant Time value to Go time.Time. 13 | func GetVariantDate(value uint64) (time.Time, error) { 14 | var st syscall.Systemtime 15 | v1 := uint32(value) 16 | v2 := uint32(value >> 32) 17 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 18 | if r != 0 { 19 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 20 | } 21 | return time.Now(), errors.New("Could not convert to time, passing current time.") 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_date_arm64.go: -------------------------------------------------------------------------------- 1 | //go:build windows && arm64 2 | // +build windows,arm64 3 | 4 | package ole 5 | 6 | import ( 7 | "errors" 8 | "syscall" 9 | "time" 10 | "unsafe" 11 | ) 12 | 13 | // GetVariantDate converts COM Variant Time value to Go time.Time. 14 | func GetVariantDate(value uint64) (time.Time, error) { 15 | var st syscall.Systemtime 16 | v1 := uint32(value) 17 | v2 := uint32(value >> 32) 18 | r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) 19 | if r != 0 { 20 | return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil 21 | } 22 | return time.Now(), errors.New("Could not convert to time, passing current time.") 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/winrt_doc.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // RoInitialize 6 | func RoInitialize(thread_type uint32) (err error) { 7 | return NewError(E_NOTIMPL) 8 | } 9 | 10 | // RoActivateInstance 11 | func RoActivateInstance(clsid string) (ins *IInspectable, err error) { 12 | return nil, NewError(E_NOTIMPL) 13 | } 14 | 15 | // RoGetActivationFactory 16 | func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { 17 | return nil, NewError(E_NOTIMPL) 18 | } 19 | 20 | // HString is handle string for pointers. 21 | type HString uintptr 22 | 23 | // NewHString returns a new HString for Go string. 24 | func NewHString(s string) (hstring HString, err error) { 25 | return HString(uintptr(0)), NewError(E_NOTIMPL) 26 | } 27 | 28 | // DeleteHString deletes HString. 29 | func DeleteHString(hstring HString) (err error) { 30 | return NewError(E_NOTIMPL) 31 | } 32 | 33 | // String returns Go string value of HString. 34 | func (h HString) String() string { 35 | return "" 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/.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 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/README.md: -------------------------------------------------------------------------------- 1 | # plan9stats 2 | A module for retrieving statistics of Plan 9 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/doc.go: -------------------------------------------------------------------------------- 1 | // Package stats provides statistic utilities for Plan 9. 2 | package stats 3 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/int.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | type intParser struct { 8 | err error 9 | } 10 | 11 | func (p *intParser) ParseInt(s string, base int) int { 12 | if p.err != nil { 13 | return 0 14 | } 15 | var n int64 16 | n, p.err = strconv.ParseInt(s, base, 0) 17 | return int(n) 18 | } 19 | 20 | func (p *intParser) ParseInt64(s string, base int) int64 { 21 | if p.err != nil { 22 | return 0 23 | } 24 | var n int64 25 | n, p.err = strconv.ParseInt(s, base, 64) 26 | return n 27 | } 28 | 29 | func (p *intParser) Err() error { 30 | return p.err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/lufia/plan9stats/opts.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | type Config struct { 4 | rootdir string 5 | } 6 | 7 | type Option func(*Config) 8 | 9 | func newConfig(opts ...Option) *Config { 10 | var cfg Config 11 | for _, opt := range opts { 12 | opt(&cfg) 13 | } 14 | return &cfg 15 | } 16 | 17 | func WithRootDir(dir string) Option { 18 | return func(cfg *Config) { 19 | cfg.rootdir = dir 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Power DevOps 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 | 23 | 24 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/config.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package perfstat 5 | 6 | /* 7 | #cgo LDFLAGS: -lperfstat 8 | 9 | #include 10 | */ 11 | import "C" 12 | 13 | func EnableLVMStat() { 14 | C.perfstat_config(C.PERFSTAT_ENABLE|C.PERFSTAT_LV|C.PERFSTAT_VG, nil) 15 | } 16 | 17 | func DisableLVMStat() { 18 | C.perfstat_config(C.PERFSTAT_DISABLE|C.PERFSTAT_LV|C.PERFSTAT_VG, nil) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/fsstat.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package perfstat 5 | 6 | /* 7 | #include "c_helpers.h" 8 | */ 9 | import "C" 10 | 11 | import ( 12 | "fmt" 13 | ) 14 | 15 | func FileSystemStat() ([]FileSystem, error) { 16 | var fsinfo *C.struct_fsinfo 17 | var nmounts C.int 18 | 19 | fsinfo = C.get_all_fs(&nmounts) 20 | if nmounts <= 0 { 21 | return nil, fmt.Errorf("No mounts found") 22 | } 23 | 24 | fs := make([]FileSystem, nmounts) 25 | for i := 0; i < int(nmounts); i++ { 26 | f := C.get_filesystem_stat(fsinfo, C.int(i)) 27 | if f != nil { 28 | fs[i] = fsinfo2filesystem(f) 29 | } 30 | } 31 | return fs, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/lparstat.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package perfstat 5 | 6 | /* 7 | #cgo LDFLAGS: -lperfstat 8 | 9 | #include 10 | #include 11 | */ 12 | import "C" 13 | 14 | import ( 15 | "fmt" 16 | "unsafe" 17 | ) 18 | 19 | func PartitionStat() (*PartitionConfig, error) { 20 | var part C.perfstat_partition_config_t 21 | 22 | rc := C.perfstat_partition_config(nil, &part, C.sizeof_perfstat_partition_config_t, 1) 23 | if rc != 1 { 24 | return nil, fmt.Errorf("perfstat_partition_config() error") 25 | } 26 | p := perfstatpartitionconfig2partitionconfig(part) 27 | return &p, nil 28 | 29 | } 30 | 31 | func LparInfo() (*PartitionInfo, error) { 32 | var pinfo C.lpar_info_format2_t 33 | 34 | rc := C.lpar_get_info(C.LPAR_INFO_FORMAT2, unsafe.Pointer(&pinfo), C.sizeof_lpar_info_format2_t) 35 | if rc != 0 { 36 | return nil, fmt.Errorf("lpar_get_info() error") 37 | } 38 | p := lparinfo2partinfo(pinfo) 39 | return &p, nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/power-devops/perfstat/uptime.go: -------------------------------------------------------------------------------- 1 | //go:build aix 2 | // +build aix 3 | 4 | package perfstat 5 | 6 | /* 7 | #include "c_helpers.h" 8 | */ 9 | import "C" 10 | 11 | import ( 12 | "fmt" 13 | "time" 14 | ) 15 | 16 | func timeSince(ts uint64) uint64 { 17 | return uint64(time.Now().Unix()) - ts 18 | } 19 | 20 | // BootTime() returns the time of the last boot in UNIX seconds 21 | func BootTime() (uint64, error) { 22 | sec := C.boottime() 23 | if sec == -1 { 24 | return 0, fmt.Errorf("Can't determine boot time") 25 | } 26 | return uint64(sec), nil 27 | } 28 | 29 | // UptimeSeconds() calculates uptime in seconds 30 | func UptimeSeconds() (uint64, error) { 31 | boot, err := BootTime() 32 | if err != nil { 33 | return 0, err 34 | } 35 | return timeSince(boot), nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/common/env.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package common 3 | 4 | type EnvKeyType string 5 | 6 | // EnvKey is a context key that can be used to set programmatically the environment 7 | // gopsutil relies on to perform calls against the OS. 8 | // Example of use: 9 | // 10 | // ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"}) 11 | // avg, err := load.AvgWithContext(ctx) 12 | var EnvKey = EnvKeyType("env") 13 | 14 | const ( 15 | HostProcEnvKey EnvKeyType = "HOST_PROC" 16 | HostSysEnvKey EnvKeyType = "HOST_SYS" 17 | HostEtcEnvKey EnvKeyType = "HOST_ETC" 18 | HostVarEnvKey EnvKeyType = "HOST_VAR" 19 | HostRunEnvKey EnvKeyType = "HOST_RUN" 20 | HostDevEnvKey EnvKeyType = "HOST_DEV" 21 | HostRootEnvKey EnvKeyType = "HOST_ROOT" 22 | HostProcMountinfo EnvKeyType = "HOST_PROC_MOUNTINFO" 23 | ) 24 | 25 | type EnvMap map[EnvKeyType]string 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build aix 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | ) 9 | 10 | func Times(percpu bool) ([]TimesStat, error) { 11 | return TimesWithContext(context.Background(), percpu) 12 | } 13 | 14 | func Info() ([]InfoStat, error) { 15 | return InfoWithContext(context.Background()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_fallback.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build darwin && !arm64 3 | 4 | package cpu 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | func getFrequency() (float64, error) { 9 | // Use the rated frequency of the CPU. This is a static value and does not 10 | // account for low power or Turbo Boost modes. 11 | cpuFrequency, err := unix.SysctlUint64("hw.cpufrequency") 12 | return float64(cpuFrequency) / 1000000.0, err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | "runtime" 9 | 10 | "github.com/shirou/gopsutil/v4/internal/common" 11 | ) 12 | 13 | func Times(percpu bool) ([]TimesStat, error) { 14 | return TimesWithContext(context.Background(), percpu) 15 | } 16 | 17 | func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { 18 | return []TimesStat{}, common.ErrNotImplementedError 19 | } 20 | 21 | func Info() ([]InfoStat, error) { 22 | return InfoWithContext(context.Background()) 23 | } 24 | 25 | func InfoWithContext(ctx context.Context) ([]InfoStat, error) { 26 | return []InfoStat{}, common.ErrNotImplementedError 27 | } 28 | 29 | func CountsWithContext(ctx context.Context, logical bool) (int, error) { 30 | return runtime.NumCPU(), nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint32 6 | Nice uint32 7 | Sys uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint32 6 | Nice uint32 7 | Sys uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint32 6 | Nice uint32 7 | Sys uint32 8 | Intr uint32 9 | Idle uint32 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Intr uint64 9 | Idle uint64 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint32 6 | Nice uint32 7 | Sys uint32 8 | Spin uint32 9 | Intr uint32 10 | Idle uint32 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Spin uint64 9 | Intr uint64 10 | Idle uint64 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint32 6 | Nice uint32 7 | Sys uint32 8 | Spin uint32 9 | Intr uint32 10 | Idle uint32 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Spin uint64 9 | Intr uint64 10 | Idle uint64 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package cpu 3 | 4 | type cpuTimes struct { 5 | User uint64 6 | Nice uint64 7 | Sys uint64 8 | Spin uint64 9 | Intr uint64 10 | Idle uint64 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/cpu/cpu_plan9.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build plan9 3 | 4 | package cpu 5 | 6 | import ( 7 | "context" 8 | "os" 9 | "runtime" 10 | 11 | stats "github.com/lufia/plan9stats" 12 | 13 | "github.com/shirou/gopsutil/v4/internal/common" 14 | ) 15 | 16 | func Times(percpu bool) ([]TimesStat, error) { 17 | return TimesWithContext(context.Background(), percpu) 18 | } 19 | 20 | func TimesWithContext(ctx context.Context, _ bool) ([]TimesStat, error) { 21 | // BUG: percpu flag is not supported yet. 22 | root := os.Getenv("HOST_ROOT") 23 | c, err := stats.ReadCPUType(ctx, stats.WithRootDir(root)) 24 | if err != nil { 25 | return nil, err 26 | } 27 | s, err := stats.ReadCPUStats(ctx, stats.WithRootDir(root)) 28 | if err != nil { 29 | return nil, err 30 | } 31 | return []TimesStat{ 32 | { 33 | CPU: c.Name, 34 | User: s.User.Seconds(), 35 | System: s.Sys.Seconds(), 36 | Idle: s.Idle.Seconds(), 37 | }, 38 | }, nil 39 | } 40 | 41 | func Info() ([]InfoStat, error) { 42 | return InfoWithContext(context.Background()) 43 | } 44 | 45 | func InfoWithContext(_ context.Context) ([]InfoStat, error) { 46 | return []InfoStat{}, common.ErrNotImplementedError 47 | } 48 | 49 | func CountsWithContext(_ context.Context, _ bool) (int, error) { 50 | return runtime.NumCPU(), nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_fallback.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !windows && !solaris && !aix 3 | 4 | package disk 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/v4/internal/common" 10 | ) 11 | 12 | func IOCountersWithContext(_ context.Context, _ ...string) (map[string]IOCountersStat, error) { 13 | return nil, common.ErrNotImplementedError 14 | } 15 | 16 | func PartitionsWithContext(_ context.Context, _ bool) ([]PartitionStat, error) { 17 | return []PartitionStat{}, common.ErrNotImplementedError 18 | } 19 | 20 | func UsageWithContext(_ context.Context, _ string) (*UsageStat, error) { 21 | return nil, common.ErrNotImplementedError 22 | } 23 | 24 | func SerialNumberWithContext(_ context.Context, _ string) (string, error) { 25 | return "", common.ErrNotImplementedError 26 | } 27 | 28 | func LabelWithContext(_ context.Context, _ string) (string, error) { 29 | return "", common.ErrNotImplementedError 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build netbsd && amd64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs types_netbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | sizeOfStatvfs = 0xce0 11 | ) 12 | 13 | type ( 14 | Statvfs struct { 15 | Flag uint64 16 | Bsize uint64 17 | Frsize uint64 18 | Iosize uint64 19 | Blocks uint64 20 | Bfree uint64 21 | Bavail uint64 22 | Bresvd uint64 23 | Files uint64 24 | Ffree uint64 25 | Favail uint64 26 | Fresvd uint64 27 | Syncreads uint64 28 | Syncwrites uint64 29 | Asyncreads uint64 30 | Asyncwrites uint64 31 | Fsidx _Ctype_struct___0 32 | Fsid uint64 33 | Namemax uint64 34 | Owner uint32 35 | Spare [4]uint64 36 | Fstypename [32]uint8 37 | Mntonname [1024]uint8 38 | Mntfromname [1024]uint8 39 | Mntfromlabel [1024]uint8 40 | } 41 | ) 42 | 43 | type _Ctype_struct___0 struct { 44 | FsidVal [2]int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | //go:build netbsd && arm 2 | // +build netbsd,arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_netbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | sizeOfStatvfs = 0xcc8 11 | ) 12 | 13 | type ( 14 | Statvfs struct { 15 | Flag uint32 16 | Bsize uint32 17 | Frsize uint32 18 | Iosize uint32 19 | Blocks uint64 20 | Bfree uint64 21 | Bavail uint64 22 | Bresvd uint64 23 | Files uint64 24 | Ffree uint64 25 | Favail uint64 26 | Fresvd uint64 27 | Syncreads uint64 28 | Syncwrites uint64 29 | Asyncreads uint64 30 | Asyncwrites uint64 31 | Fsidx _Ctype_struct___0 32 | Fsid uint32 33 | Namemax uint32 34 | Owner uint32 35 | Pad_cgo_0 [4]byte 36 | Spare [4]uint64 37 | Fstypename [32]uint8 38 | Mntonname [1024]uint8 39 | Mntfromname [1024]uint8 40 | Mntfromlabel [1024]uint8 41 | } 42 | ) 43 | 44 | type _Ctype_struct___0 struct { 45 | FsidVal [2]int32 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build netbsd && arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs types_netbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | sizeOfStatvfs = 0xce0 11 | ) 12 | 13 | type ( 14 | Statvfs struct { 15 | Flag uint64 16 | Bsize uint64 17 | Frsize uint64 18 | Iosize uint64 19 | Blocks uint64 20 | Bfree uint64 21 | Bavail uint64 22 | Bresvd uint64 23 | Files uint64 24 | Ffree uint64 25 | Favail uint64 26 | Fresvd uint64 27 | Syncreads uint64 28 | Syncwrites uint64 29 | Asyncreads uint64 30 | Asyncwrites uint64 31 | Fsidx _Ctype_struct___0 32 | Fsid uint64 33 | Namemax uint64 34 | Owner uint32 35 | Spare [4]uint64 36 | Fstypename [32]uint8 37 | Mntonname [1024]uint8 38 | Mntfromname [1024]uint8 39 | Mntfromlabel [1024]uint8 40 | } 41 | ) 42 | 43 | type _Ctype_struct___0 struct { 44 | FsidVal [2]int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && 386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x60 18 | ) 19 | 20 | type Diskstats struct { 21 | Name [16]int8 22 | Busy int32 23 | Rxfer uint64 24 | Wxfer uint64 25 | Seek uint64 26 | Rbytes uint64 27 | Wbytes uint64 28 | Attachtime Timeval 29 | Timestamp Timeval 30 | Time Timeval 31 | } 32 | type Timeval struct { 33 | Sec int64 34 | Usec int32 35 | } 36 | 37 | type ( 38 | Diskstat struct{} 39 | bintime struct{} 40 | ) 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 3 | // cgo -godefs types_openbsd.go 4 | 5 | package disk 6 | 7 | const ( 8 | devstat_NO_DATA = 0x00 9 | devstat_READ = 0x01 10 | devstat_WRITE = 0x02 11 | devstat_FREE = 0x03 12 | ) 13 | 14 | const ( 15 | sizeOfDiskstats = 0x70 16 | ) 17 | 18 | type Diskstats struct { 19 | Name [16]int8 20 | Busy int32 21 | Pad_cgo_0 [4]byte 22 | Rxfer uint64 23 | Wxfer uint64 24 | Seek uint64 25 | Rbytes uint64 26 | Wbytes uint64 27 | Attachtime Timeval 28 | Timestamp Timeval 29 | Time Timeval 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int64 34 | } 35 | 36 | type ( 37 | Diskstat struct{} 38 | bintime struct{} 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x60 18 | ) 19 | 20 | type Diskstats struct { 21 | Name [16]int8 22 | Busy int32 23 | Rxfer uint64 24 | Wxfer uint64 25 | Seek uint64 26 | Rbytes uint64 27 | Wbytes uint64 28 | Attachtime Timeval 29 | Timestamp Timeval 30 | Time Timeval 31 | } 32 | type Timeval struct { 33 | Sec int64 34 | Usec int32 35 | } 36 | 37 | type ( 38 | Diskstat struct{} 39 | bintime struct{} 40 | ) 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x70 18 | ) 19 | 20 | type Diskstats struct { 21 | Name [16]int8 22 | Busy int32 23 | Rxfer uint64 24 | Wxfer uint64 25 | Seek uint64 26 | Rbytes uint64 27 | Wbytes uint64 28 | Attachtime Timeval 29 | Timestamp Timeval 30 | Time Timeval 31 | } 32 | type Timeval struct { 33 | Sec int64 34 | Usec int64 35 | } 36 | 37 | type ( 38 | Diskstat struct{} 39 | bintime struct{} 40 | ) 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/disk/disk_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs disk/types_openbsd.go 6 | 7 | package disk 8 | 9 | const ( 10 | devstat_NO_DATA = 0x00 11 | devstat_READ = 0x01 12 | devstat_WRITE = 0x02 13 | devstat_FREE = 0x03 14 | ) 15 | 16 | const ( 17 | sizeOfDiskstats = 0x70 18 | ) 19 | 20 | type ( 21 | Diskstats struct { 22 | Name [16]int8 23 | Busy int32 24 | Rxfer uint64 25 | Wxfer uint64 26 | Seek uint64 27 | Rbytes uint64 28 | Wbytes uint64 29 | Attachtime Timeval 30 | Timestamp Timeval 31 | Time Timeval 32 | } 33 | Timeval struct { 34 | Sec int64 35 | Usec int64 36 | } 37 | ) 38 | 39 | type ( 40 | Diskstat struct{} 41 | bintime struct{} 42 | ) 43 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | //go:build aix && ppc64 && cgo 2 | // +build aix,ppc64,cgo 3 | 4 | // Guessed at from the following document: 5 | // https://www.ibm.com/docs/sl/ibm-mq/9.2?topic=platforms-standard-data-types-aix-linux-windows 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x180 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type utmp struct { 26 | Type int16 27 | Pad_cgo_0 [2]byte 28 | Pid int32 29 | Line [32]int8 30 | Id [4]int8 31 | User [32]int8 32 | Host [256]int8 33 | Exit exit_status 34 | Session int32 35 | Tv timeval 36 | Addr_v6 [4]int32 37 | X__glibc_reserved [20]int8 38 | } 39 | 40 | type exit_status struct { 41 | Termination int16 42 | Exit int16 43 | } 44 | 45 | type timeval struct { 46 | Sec int64 47 | Usec int64 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_bsd.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build darwin || freebsd || openbsd || netbsd 3 | 4 | package host 5 | 6 | import ( 7 | "context" 8 | "sync/atomic" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | // cachedBootTime must be accessed via atomic.Load/StoreUint64 14 | var cachedBootTime uint64 15 | 16 | func BootTimeWithContext(_ context.Context) (uint64, error) { 17 | if enableBootTimeCache { 18 | t := atomic.LoadUint64(&cachedBootTime) 19 | if t != 0 { 20 | return t, nil 21 | } 22 | } 23 | tv, err := unix.SysctlTimeval("kern.boottime") 24 | if err != nil { 25 | return 0, err 26 | } 27 | 28 | if enableBootTimeCache { 29 | atomic.StoreUint64(&cachedBootTime, uint64(tv.Sec)) 30 | } 31 | 32 | return uint64(tv.Sec), nil 33 | } 34 | 35 | func UptimeWithContext(ctx context.Context) (uint64, error) { 36 | boot, err := BootTimeWithContext(ctx) 37 | if err != nil { 38 | return 0, err 39 | } 40 | return timeSince(boot), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_darwin.go 4 | 5 | package host 6 | 7 | type Utmpx struct { 8 | User [256]int8 9 | ID [4]int8 10 | Line [32]int8 11 | Pid int32 12 | Type int16 13 | Pad_cgo_0 [6]byte 14 | Tv Timeval 15 | Host [256]int8 16 | Pad [16]uint32 17 | } 18 | 19 | type Timeval struct { 20 | Sec int32 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build darwin && arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_darwin.go 6 | 7 | package host 8 | 9 | type Utmpx struct { 10 | User [256]int8 11 | Id [4]int8 12 | Line [32]int8 13 | Pid int32 14 | Type int16 15 | Tv Timeval 16 | Host [256]int8 17 | Pad [16]uint32 18 | } 19 | type Timeval struct { 20 | Sec int64 21 | Usec int32 22 | Pad_cgo_0 [4]byte 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 3 | // cgo -godefs types_freebsd.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x4 12 | sizeofLongLong = 0x8 13 | sizeOfUtmpx = 0xc5 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type Utmp struct { 24 | Line [8]int8 25 | Name [16]int8 26 | Host [16]int8 27 | Time int32 28 | } 29 | 30 | type Utmpx struct { 31 | Type uint8 32 | Tv uint64 33 | Id [8]int8 34 | Pid uint32 35 | User [32]int8 36 | Line [16]int8 37 | Host [128]int8 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 3 | // cgo -godefs types_freebsd.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x8 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x8 12 | sizeofLongLong = 0x8 13 | sizeOfUtmpx = 0xc5 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int64 20 | _C_long_long int64 21 | ) 22 | 23 | type Utmp struct { 24 | Line [8]int8 25 | Name [16]int8 26 | Host [16]int8 27 | Time int32 28 | } 29 | 30 | type Utmpx struct { 31 | Type uint8 32 | Tv uint64 33 | Id [8]int8 34 | Pid uint32 35 | User [32]int8 36 | Line [16]int8 37 | Host [128]int8 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 3 | // cgo -godefs types_freebsd.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x8 12 | sizeofLongLong = 0x8 13 | sizeOfUtmpx = 0xc5 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type Utmp struct { 24 | Line [8]int8 25 | Name [16]int8 26 | Host [16]int8 27 | Time int32 28 | } 29 | 30 | type Utmpx struct { 31 | Type uint8 32 | Tv uint64 33 | Id [8]int8 34 | Pid uint32 35 | User [32]int8 36 | Line [16]int8 37 | Host [128]int8 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build freebsd && arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_freebsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmpx = 0xc5 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [16]int8 28 | Host [16]int8 29 | Time int32 30 | } 31 | 32 | type Utmpx struct { 33 | Type uint8 34 | Tv uint64 35 | Id [8]int8 36 | Pid uint32 37 | User [32]int8 38 | Line [16]int8 39 | Host [128]int8 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // ATTENTION - FILE MANUAL FIXED AFTER CGO. 3 | // Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv 4 | // Created by cgo -godefs, MANUAL FIXED 5 | // cgo -godefs types_linux.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x180 16 | ) 17 | 18 | type ( 19 | _C_short int16 //nolint:revive //FIXME 20 | _C_int int32 //nolint:revive //FIXME 21 | _C_long int32 //nolint:revive //FIXME 22 | _C_long_long int64 //nolint:revive //FIXME 23 | ) 24 | 25 | type utmp struct { 26 | Type int16 27 | Pad_cgo_0 [2]byte //nolint:revive //FIXME 28 | Pid int32 29 | Line [32]int8 30 | ID [4]int8 31 | User [32]int8 32 | Host [256]int8 33 | Exit exit_status 34 | Session int32 35 | Tv UtTv 36 | Addr_v6 [4]int32 //nolint:revive //FIXME 37 | X__unused [20]int8 //nolint:revive //FIXME 38 | } 39 | 40 | type exit_status struct { //nolint:revive //FIXME 41 | Termination int16 42 | Exit int16 43 | } 44 | 45 | type UtTv struct { 46 | Sec int32 47 | Usec int32 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x8 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x8 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int64 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte 26 | Pid int32 27 | Line [32]int8 28 | Id [4]int8 29 | User [32]int8 30 | Host [256]int8 31 | Exit exit_status 32 | Session int32 33 | Tv _Ctype_struct___0 34 | Addr_v6 [4]int32 35 | X__glibc_reserved [20]int8 36 | } 37 | 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | 43 | type timeval struct { 44 | Sec int64 45 | Usec int64 46 | } 47 | 48 | type _Ctype_struct___0 struct { 49 | Sec int32 50 | Usec int32 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go | sed "s/uint8/int8/g" 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x4 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte 26 | Pid int32 27 | Line [32]int8 28 | Id [4]int8 29 | User [32]int8 30 | Host [256]int8 31 | Exit exit_status 32 | Session int32 33 | Tv timeval 34 | Addr_v6 [4]int32 35 | X__glibc_reserved [20]int8 36 | } 37 | 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | 43 | type timeval struct { 44 | Sec int32 45 | Usec int32 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x190 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type ( 23 | utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte // changed by hand #1603 26 | Pid int32 27 | Line [32]int8 // changed by hand 28 | Id [4]int8 // changed by hand 29 | User [32]int8 // changed by hand 30 | Host [256]int8 // changed by hand 31 | Exit exit_status 32 | Session int64 33 | Tv timeval 34 | Addr_v6 [4]int32 35 | X__glibc_reserved [20]uint8 36 | Pad_cgo_1 [4]byte 37 | } 38 | exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | timeval struct { 43 | Sec int64 44 | Usec int64 45 | } 46 | ) 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_loong64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 3 | // cgo -godefs host/types_linux.go 4 | 5 | //go:build linux && loong64 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x190 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type ( 26 | utmp struct { 27 | Type int16 28 | Pid int32 29 | Line [32]int8 30 | Id [4]int8 31 | User [32]int8 32 | Host [256]int8 33 | Exit exit_status 34 | Session int64 35 | Tv timeval 36 | Addr_v6 [4]int32 37 | X__glibc_reserved [20]int8 38 | Pad_cgo_0 [4]byte 39 | } 40 | exit_status struct { 41 | Termination int16 42 | Exit int16 43 | } 44 | timeval struct { 45 | Sec int64 46 | Usec int64 47 | } 48 | ) 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x4 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte 26 | Pid int32 27 | Line [32]int8 28 | Id [4]int8 29 | User [32]int8 30 | Host [256]int8 31 | Exit exit_status 32 | Session int32 33 | Tv timeval 34 | Addr_v6 [4]int32 35 | X__unused [20]int8 36 | } 37 | 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | 43 | type timeval struct { 44 | Sec int32 45 | Usec int32 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x4 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte 26 | Pid int32 27 | Line [32]int8 28 | Id [4]int8 29 | User [32]int8 30 | Host [256]int8 31 | Exit exit_status 32 | Session int32 33 | Tv timeval 34 | Addr_v6 [4]int32 35 | X__unused [20]int8 36 | } 37 | 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | 43 | type timeval struct { 44 | Sec int32 45 | Usec int32 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x4 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte 26 | Pid int32 27 | Line [32]int8 28 | Id [4]int8 29 | User [32]int8 30 | Host [256]int8 31 | Exit exit_status 32 | Session int32 33 | Tv timeval 34 | Addr_v6 [4]int32 35 | X__unused [20]int8 36 | } 37 | 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | 43 | type timeval struct { 44 | Sec int32 45 | Usec int32 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x4 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x4 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pad_cgo_0 [2]byte 26 | Pid int32 27 | Line [32]int8 28 | Id [4]int8 29 | User [32]int8 30 | Host [256]int8 31 | Exit exit_status 32 | Session int32 33 | Tv timeval 34 | Addr_v6 [4]int32 35 | X__unused [20]int8 36 | } 37 | 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | 43 | type timeval struct { 44 | Sec int32 45 | Usec int32 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build linux && ppc64 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_linux.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x180 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type utmp struct { 26 | Type int16 27 | Pad_cgo_0 [2]byte 28 | Pid int32 29 | Line [32]int8 30 | Id [4]int8 31 | User [32]int8 32 | Host [256]int8 33 | Exit exit_status 34 | Session int32 35 | Tv timeval 36 | Addr_v6 [4]int32 37 | X__glibc_reserved [20]int8 38 | } 39 | 40 | type exit_status struct { 41 | Termination int16 42 | Exit int16 43 | } 44 | 45 | type timeval struct { 46 | Sec int64 47 | Usec int64 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build linux && ppc64le 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_linux.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x180 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type utmp struct { 26 | Type int16 27 | Pad_cgo_0 [2]byte 28 | Pid int32 29 | Line [32]int8 30 | Id [4]int8 31 | User [32]int8 32 | Host [256]int8 33 | Exit exit_status 34 | Session int32 35 | Tv timeval 36 | Addr_v6 [4]int32 37 | X__glibc_reserved [20]int8 38 | } 39 | 40 | type exit_status struct { 41 | Termination int16 42 | Exit int16 43 | } 44 | 45 | type timeval struct { 46 | Sec int64 47 | Usec int64 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_riscv64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_linux.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x8 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x8 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x180 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int64 20 | _C_long_long int64 21 | ) 22 | 23 | type utmp struct { 24 | Type int16 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv _Ctype_struct___0 33 | Addr_v6 [4]int32 34 | X__glibc_reserved [20]uint8 35 | } 36 | 37 | type exit_status struct { 38 | Termination int16 39 | Exit int16 40 | } 41 | 42 | type timeval struct { 43 | Sec int64 44 | Usec int64 45 | } 46 | 47 | type _Ctype_struct___0 struct { 48 | Sec int32 49 | Usec int32 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build linux && s390x 3 | 4 | // Created by cgo -godefs - DO NOT EDIT 5 | // cgo -godefs types_linux.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x180 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type utmp struct { 26 | Type int16 27 | Pad_cgo_0 [2]byte 28 | Pid int32 29 | Line [32]int8 30 | Id [4]int8 31 | User [32]int8 32 | Host [256]int8 33 | Exit exit_status 34 | Session int32 35 | Tv timeval 36 | Addr_v6 [4]int32 37 | X__glibc_reserved [20]int8 38 | } 39 | 40 | type exit_status struct { 41 | Termination int16 42 | Exit int16 43 | } 44 | 45 | type timeval struct { 46 | Sec int64 47 | Usec int64 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && 386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int32 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_openbsd.go 4 | 5 | package host 6 | 7 | const ( 8 | sizeofPtr = 0x8 9 | sizeofShort = 0x2 10 | sizeofInt = 0x4 11 | sizeofLong = 0x8 12 | sizeofLongLong = 0x8 13 | sizeOfUtmp = 0x130 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int64 20 | _C_long_long int64 21 | ) 22 | 23 | type Utmp struct { 24 | Line [8]int8 25 | Name [32]int8 26 | Host [256]int8 27 | Time int64 28 | } 29 | 30 | type Timeval struct { 31 | Sec int64 32 | Usec int64 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x4 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x4 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int32 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type Utmp struct { 26 | Line [8]int8 27 | Name [32]int8 28 | Host [256]int8 29 | Time int64 30 | } 31 | type Timeval struct { 32 | Sec int64 33 | Usec int64 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs host/types_openbsd.go 6 | 7 | package host 8 | 9 | const ( 10 | sizeofPtr = 0x8 11 | sizeofShort = 0x2 12 | sizeofInt = 0x4 13 | sizeofLong = 0x8 14 | sizeofLongLong = 0x8 15 | sizeOfUtmp = 0x130 16 | ) 17 | 18 | type ( 19 | _C_short int16 20 | _C_int int32 21 | _C_long int64 22 | _C_long_long int64 23 | ) 24 | 25 | type ( 26 | Utmp struct { 27 | Line [8]int8 28 | Name [32]int8 29 | Host [256]int8 30 | Time int64 31 | } 32 | Timeval struct { 33 | Sec int64 34 | Usec int64 35 | } 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/host/host_posix.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build linux || freebsd || openbsd || netbsd || darwin || solaris 3 | 4 | package host 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | func KernelArch() (string, error) { 9 | var utsname unix.Utsname 10 | err := unix.Uname(&utsname) 11 | if err != nil { 12 | return "", err 13 | } 14 | return unix.ByteSliceToString(utsname.Machine[:]), nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/internal/common/common_unix.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build linux || freebsd || darwin || openbsd 3 | 4 | package common 5 | 6 | import ( 7 | "context" 8 | "errors" 9 | "os/exec" 10 | "strconv" 11 | "strings" 12 | ) 13 | 14 | func CallLsofWithContext(ctx context.Context, invoke Invoker, pid int32, args ...string) ([]string, error) { 15 | var cmd []string 16 | if pid == 0 { // will get from all processes. 17 | cmd = []string{"-a", "-n", "-P"} 18 | } else { 19 | cmd = []string{"-a", "-n", "-P", "-p", strconv.Itoa(int(pid))} 20 | } 21 | cmd = append(cmd, args...) 22 | out, err := invoke.CommandWithContext(ctx, "lsof", cmd...) 23 | if err != nil { 24 | if errors.Is(err, exec.ErrNotFound) { 25 | return []string{}, err 26 | } 27 | // if no pid found, lsof returns code 1. 28 | if err.Error() == "exit status 1" && len(out) == 0 { 29 | return []string{}, nil 30 | } 31 | } 32 | lines := strings.Split(string(out), "\n") 33 | 34 | var ret []string 35 | for _, l := range lines[1:] { 36 | if l == "" { 37 | continue 38 | } 39 | ret = append(ret, l) 40 | } 41 | return ret, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/internal/common/endian.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package common 3 | 4 | import "unsafe" 5 | 6 | // IsLittleEndian checks if the current platform uses little-endian. 7 | // copied from https://github.com/ntrrg/ntgo/blob/v0.8.0/runtime/infrastructure.go#L16 (MIT License) 8 | func IsLittleEndian() bool { 9 | var x int16 = 0x0011 10 | return *(*byte)(unsafe.Pointer(&x)) == 0x11 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/internal/common/readlink_linux.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "errors" 5 | "os" 6 | "sync" 7 | "syscall" 8 | ) 9 | 10 | var bufferPool = sync.Pool{ 11 | New: func() any { 12 | b := make([]byte, syscall.PathMax) 13 | return &b 14 | }, 15 | } 16 | 17 | // The following three functions are copied from stdlib. 18 | 19 | // ignoringEINTR2 is ignoringEINTR, but returning an additional value. 20 | func ignoringEINTR2[T any](fn func() (T, error)) (T, error) { 21 | for { 22 | v, err := fn() 23 | if !errors.Is(err, syscall.EINTR) { 24 | return v, err 25 | } 26 | } 27 | } 28 | 29 | // Many functions in package syscall return a count of -1 instead of 0. 30 | // Using fixCount(call()) instead of call() corrects the count. 31 | func fixCount(n int, err error) (int, error) { 32 | if n < 0 { 33 | n = 0 34 | } 35 | return n, err 36 | } 37 | 38 | // Readlink behaves like os.Readlink but caches the buffer passed to syscall.Readlink. 39 | func Readlink(name string) (string, error) { 40 | b := bufferPool.Get().(*[]byte) 41 | 42 | n, err := ignoringEINTR2(func() (int, error) { 43 | return fixCount(syscall.Readlink(name, *b)) 44 | }) 45 | if err != nil { 46 | bufferPool.Put(b) 47 | return "", &os.PathError{Op: "readlink", Path: name, Err: err} 48 | } 49 | 50 | result := string((*b)[:n]) 51 | bufferPool.Put(b) 52 | return result, nil 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/internal/common/sleep.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package common 3 | 4 | import ( 5 | "context" 6 | "time" 7 | ) 8 | 9 | // Sleep awaits for provided interval. 10 | // Can be interrupted by context cancellation. 11 | func Sleep(ctx context.Context, interval time.Duration) error { 12 | timer := time.NewTimer(interval) 13 | select { 14 | case <-ctx.Done(): 15 | if !timer.Stop() { 16 | <-timer.C 17 | } 18 | return ctx.Err() 19 | case <-timer.C: 20 | return nil 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/internal/common/warnings.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | package common 3 | 4 | import "fmt" 5 | 6 | type Warnings struct { 7 | List []error 8 | Verbose bool 9 | } 10 | 11 | func (w *Warnings) Add(err error) { 12 | w.List = append(w.List, err) 13 | } 14 | 15 | func (w *Warnings) Reference() error { 16 | if len(w.List) > 0 { 17 | return w 18 | } 19 | return nil 20 | } 21 | 22 | func (w *Warnings) Error() string { 23 | if w.Verbose { 24 | str := "" 25 | for i, e := range w.List { 26 | str += fmt.Sprintf("\tError %d: %s\n", i, e.Error()) 27 | } 28 | return str 29 | } 30 | return fmt.Sprintf("Number of warnings: %v", len(w.List)) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/ex_linux.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build linux 3 | 4 | package mem 5 | 6 | import ( 7 | "context" 8 | "encoding/json" 9 | ) 10 | 11 | type ExVirtualMemory struct { 12 | ActiveFile uint64 `json:"activefile"` 13 | InactiveFile uint64 `json:"inactivefile"` 14 | ActiveAnon uint64 `json:"activeanon"` 15 | InactiveAnon uint64 `json:"inactiveanon"` 16 | Unevictable uint64 `json:"unevictable"` 17 | } 18 | 19 | func (v ExVirtualMemory) String() string { 20 | s, _ := json.Marshal(v) 21 | return string(s) 22 | } 23 | 24 | type ExLinux struct{} 25 | 26 | func NewExLinux() *ExLinux { 27 | return &ExLinux{} 28 | } 29 | 30 | func (ex *ExLinux) VirtualMemory() (*ExVirtualMemory, error) { 31 | return ex.VirtualMemoryWithContext(context.Background()) 32 | } 33 | 34 | func (*ExLinux) VirtualMemoryWithContext(ctx context.Context) (*ExVirtualMemory, error) { 35 | _, vmEx, err := fillFromMeminfoWithContext(ctx) 36 | if err != nil { 37 | return nil, err 38 | } 39 | return vmEx, nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_aix.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build aix 3 | 4 | package mem 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/v4/internal/common" 10 | ) 11 | 12 | func VirtualMemory() (*VirtualMemoryStat, error) { 13 | return VirtualMemoryWithContext(context.Background()) 14 | } 15 | 16 | func SwapMemory() (*SwapMemoryStat, error) { 17 | return SwapMemoryWithContext(context.Background()) 18 | } 19 | 20 | func SwapDevices() ([]*SwapDevice, error) { 21 | return nil, common.ErrNotImplementedError 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_fallback.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build !darwin && !linux && !freebsd && !openbsd && !solaris && !windows && !plan9 && !aix && !netbsd 3 | 4 | package mem 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/v4/internal/common" 10 | ) 11 | 12 | func VirtualMemory() (*VirtualMemoryStat, error) { 13 | return VirtualMemoryWithContext(context.Background()) 14 | } 15 | 16 | func VirtualMemoryWithContext(_ context.Context) (*VirtualMemoryStat, error) { 17 | return nil, common.ErrNotImplementedError 18 | } 19 | 20 | func SwapMemory() (*SwapMemoryStat, error) { 21 | return SwapMemoryWithContext(context.Background()) 22 | } 23 | 24 | func SwapMemoryWithContext(_ context.Context) (*SwapMemoryStat, error) { 25 | return nil, common.ErrNotImplementedError 26 | } 27 | 28 | func SwapDevices() ([]*SwapDevice, error) { 29 | return SwapDevicesWithContext(context.Background()) 30 | } 31 | 32 | func SwapDevicesWithContext(_ context.Context) ([]*SwapDevice, error) { 33 | return nil, common.ErrNotImplementedError 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && 386 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | // Created by cgo -godefs - DO NOT EDIT 3 | // cgo -godefs types_openbsd.go 4 | 5 | package mem 6 | 7 | const ( 8 | CTLVfs = 10 9 | VfsGeneric = 0 10 | VfsBcacheStat = 3 11 | ) 12 | 13 | const ( 14 | sizeOfBcachestats = 0x78 15 | ) 16 | 17 | type Bcachestats struct { 18 | Numbufs int64 19 | Numbufpages int64 20 | Numdirtypages int64 21 | Numcleanpages int64 22 | Pendingwrites int64 23 | Pendingreads int64 24 | Numwrites int64 25 | Numreads int64 26 | Cachehits int64 27 | Busymapped int64 28 | Dmapages int64 29 | Highpages int64 30 | Delwribufs int64 31 | Kvaslots int64 32 | Avail int64 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && arm 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && arm64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build openbsd && riscv64 3 | 4 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 5 | // cgo -godefs mem/types_openbsd.go 6 | 7 | package mem 8 | 9 | const ( 10 | CTLVfs = 10 11 | VfsGeneric = 0 12 | VfsBcacheStat = 3 13 | ) 14 | 15 | const ( 16 | sizeOfBcachestats = 0x90 17 | ) 18 | 19 | type Bcachestats struct { 20 | Numbufs int64 21 | Numbufpages int64 22 | Numdirtypages int64 23 | Numcleanpages int64 24 | Pendingwrites int64 25 | Pendingreads int64 26 | Numwrites int64 27 | Numreads int64 28 | Cachehits int64 29 | Busymapped int64 30 | Dmapages int64 31 | Highpages int64 32 | Delwribufs int64 33 | Kvaslots int64 34 | Avail int64 35 | Highflips int64 36 | Highflops int64 37 | Dmaflips int64 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/v4/net/net_aix_cgo.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-3-Clause 2 | //go:build aix && cgo 3 | 4 | package net 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/power-devops/perfstat" 10 | ) 11 | 12 | func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) { 13 | ifs, err := perfstat.NetIfaceStat() 14 | if err != nil { 15 | return nil, err 16 | } 17 | 18 | iocounters := make([]IOCountersStat, 0, len(ifs)) 19 | for _, netif := range ifs { 20 | n := IOCountersStat{ 21 | Name: netif.Name, 22 | BytesSent: uint64(netif.OBytes), 23 | BytesRecv: uint64(netif.IBytes), 24 | PacketsSent: uint64(netif.OPackets), 25 | PacketsRecv: uint64(netif.IPackets), 26 | Errin: uint64(netif.OErrors), 27 | Errout: uint64(netif.IErrors), 28 | Dropout: uint64(netif.XmitDrops), 29 | } 30 | iocounters = append(iocounters, n) 31 | } 32 | if !pernic { 33 | return getIOCountersAll(iocounters), nil 34 | } 35 | return iocounters, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.24.0 4 | 5 | freebsd_13_task: 6 | freebsd_instance: 7 | image_family: freebsd-13-5 8 | install_script: | 9 | pkg install -y go 10 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 11 | bin/${GO_VERSION} download 12 | build_script: bin/${GO_VERSION} build -v ./... 13 | test_script: bin/${GO_VERSION} test -race ./... 14 | 15 | freebsd_14_task: 16 | freebsd_instance: 17 | image_family: freebsd-14-2 18 | install_script: | 19 | pkg install -y go 20 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 21 | bin/${GO_VERSION} download 22 | build_script: bin/${GO_VERSION} build -v ./... 23 | test_script: bin/${GO_VERSION} test -race ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Tobias Klauser. 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 sysconf implements the sysconf(3) function and provides the 6 | // associated SC_* constants to query system configuration values. 7 | package sysconf 8 | 9 | import "errors" 10 | 11 | //go:generate go run mksysconf.go 12 | 13 | var errInvalid = errors.New("invalid parameter value") 14 | 15 | // Sysconf returns the value of a sysconf(3) runtime system parameter. 16 | // The name parameter should be a SC_* constant define in this package. The 17 | // implementation is GOOS-specific and certain SC_* constants might not be 18 | // defined for all GOOSes. 19 | func Sysconf(name int) (int64, error) { 20 | return sysconf(name) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Tobias Klauser. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd 6 | 7 | package sysconf 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | func pathconf(path string, name int) int64 { 12 | if val, err := unix.Pathconf(path, name); err == nil { 13 | return int64(val) 14 | } 15 | return -1 16 | } 17 | 18 | func sysctl32(name string) int64 { 19 | if val, err := unix.SysctlUint32(name); err == nil { 20 | return int64(val) 21 | } 22 | return -1 23 | } 24 | 25 | func sysctl64(name string) int64 { 26 | if val, err := unix.SysctlUint64(name); err == nil { 27 | return int64(val) 28 | } 29 | return -1 30 | } 31 | 32 | func yesno(val int64) int64 { 33 | if val == 0 { 34 | return -1 35 | } 36 | return val 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package sysconf 8 | 9 | import "os" 10 | 11 | func sysconfGeneric(name int) (int64, error) { 12 | // POSIX default values 13 | if sc, err := sysconfPOSIX(name); err == nil { 14 | return sc, nil 15 | } 16 | 17 | switch name { 18 | case SC_BC_BASE_MAX: 19 | return _BC_BASE_MAX, nil 20 | case SC_BC_DIM_MAX: 21 | return _BC_DIM_MAX, nil 22 | case SC_BC_SCALE_MAX: 23 | return _BC_SCALE_MAX, nil 24 | case SC_BC_STRING_MAX: 25 | return _BC_STRING_MAX, nil 26 | case SC_COLL_WEIGHTS_MAX: 27 | return _COLL_WEIGHTS_MAX, nil 28 | case SC_EXPR_NEST_MAX: 29 | return _EXPR_NEST_MAX, nil 30 | case SC_HOST_NAME_MAX: 31 | return _HOST_NAME_MAX, nil 32 | case SC_LINE_MAX: 33 | return _LINE_MAX, nil 34 | case SC_LOGIN_NAME_MAX: 35 | return _LOGIN_NAME_MAX, nil 36 | case SC_PAGESIZE: // same as SC_PAGE_SIZE 37 | return int64(os.Getpagesize()), nil 38 | case SC_RE_DUP_MAX: 39 | return _RE_DUP_MAX, nil 40 | case SC_SYMLOOP_MAX: 41 | return _SYMLOOP_MAX, nil 42 | } 43 | 44 | return -1, errInvalid 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. 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 sysconf 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | func sysconf(name int) (int64, error) { 10 | if name < 0 { 11 | return -1, errInvalid 12 | } 13 | return unix.Sysconf(name) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/sysconf_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris 6 | 7 | package sysconf 8 | 9 | import ( 10 | "fmt" 11 | "runtime" 12 | ) 13 | 14 | func sysconf(name int) (int64, error) { 15 | return -1, fmt.Errorf("unsupported on %s", runtime.GOOS) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && 386 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffff 10 | _SHRT_MAX = 0x7fff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && amd64 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffffffffffff 10 | _SHRT_MAX = 0x7fff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && arm 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffff 10 | _SHRT_MAX = 0x7fff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && arm64 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffffffffffff 10 | _SHRT_MAX = 0x7fff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_freebsd.go 3 | 4 | //go:build freebsd && riscv64 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffffffffffff 10 | _SHRT_MAX = 0x7fff 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && 386 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffff 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && amd64 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffffffffffff 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && arm 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffff 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/go-sysconf/zsysconf_values_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs sysconf_values_netbsd.go 3 | 4 | //go:build netbsd && arm64 5 | 6 | package sysconf 7 | 8 | const ( 9 | _LONG_MAX = 0x7fffffffffffffff 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/numcpus/.cirrus.yml: -------------------------------------------------------------------------------- 1 | env: 2 | CIRRUS_CLONE_DEPTH: 1 3 | GO_VERSION: go1.24.0 4 | 5 | freebsd_13_task: 6 | freebsd_instance: 7 | image_family: freebsd-13-5 8 | install_script: | 9 | pkg install -y go 10 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 11 | bin/${GO_VERSION} download 12 | build_script: bin/${GO_VERSION} build -v ./... 13 | test_script: bin/${GO_VERSION} test -race ./... 14 | 15 | freebsd_14_task: 16 | freebsd_instance: 17 | image_family: freebsd-14-2 18 | install_script: | 19 | pkg install -y go 20 | GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest 21 | bin/${GO_VERSION} download 22 | build_script: bin/${GO_VERSION} build -v ./... 23 | test_script: bin/${GO_VERSION} test -race ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/numcpus/numcpus_list_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 Tobias Klauser 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !linux 16 | 17 | package numcpus 18 | 19 | func listOffline() ([]int, error) { 20 | return nil, ErrNotSupported 21 | } 22 | 23 | func listOnline() ([]int, error) { 24 | return nil, ErrNotSupported 25 | } 26 | 27 | func listPossible() ([]int, error) { 28 | return nil, ErrNotSupported 29 | } 30 | 31 | func listPresent() ([]int, error) { 32 | return nil, ErrNotSupported 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/tklauser/numcpus/numcpus_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 Tobias Klauser 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows 16 | 17 | package numcpus 18 | 19 | func getConfigured() (int, error) { 20 | return 0, ErrNotSupported 21 | } 22 | 23 | func getKernelMax() (int, error) { 24 | return 0, ErrNotSupported 25 | } 26 | 27 | func getOffline() (int, error) { 28 | return 0, ErrNotSupported 29 | } 30 | 31 | func getOnline() (int, error) { 32 | return 0, ErrNotSupported 33 | } 34 | 35 | func getPossible() (int, error) { 36 | return 0, ErrNotSupported 37 | } 38 | 39 | func getPresent() (int, error) { 40 | return 0, ErrNotSupported 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/yusufpapurcu/wmi/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Stack Exchange 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/yusufpapurcu/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface to Windows WMI. 5 | 6 | Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. 7 | -------------------------------------------------------------------------------- /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/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_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_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_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_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_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/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/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/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_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_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_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/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_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/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/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/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/registry/mksyscall.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 generate 6 | 7 | package registry 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall.go 10 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------