]> Cypherpunks repositories - gostls13.git/commitdiff
all: update golang.org/x/sys to v0.26.0
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>
Thu, 31 Oct 2024 03:18:38 +0000 (11:18 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 31 Oct 2024 19:23:01 +0000 (19:23 +0000)
Commands run (in both src and src/cmd):
go get golang.org/x/sys@v0.26.0
go mod tidy
go mod vendor

This is in preparation for vendoring an updated x/tools it has a
requirement on x/sys v0.26.0.

Change-Id: I122bb3a3bc97610ba71c52263b99c56e3354b59d
Reviewed-on: https://go-review.googlesource.com/c/go/+/623855
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Carlos Amedee <carlos@golang.org>
62 files changed:
src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/sys/unix/README.md
src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh
src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_hurd.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/vgetrandom_linux.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/windows/dll_windows.go
src/cmd/vendor/golang.org/x/sys/windows/syscall_windows.go
src/cmd/vendor/golang.org/x/sys/windows/types_windows.go
src/cmd/vendor/golang.org/x/sys/windows/zsyscall_windows.go
src/cmd/vendor/modules.txt
src/go.mod
src/go.sum
src/vendor/golang.org/x/sys/cpu/cpu.go
src/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
src/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go [new file with mode: 0644]
src/vendor/golang.org/x/sys/cpu/cpu_riscv64.go
src/vendor/modules.txt

index f25fc82fd1be727cb4e576f5d8ab2eff06a33c72..4535c16d18a935b42f55421bd93cfd6813c3e469 100644 (file)
@@ -8,7 +8,7 @@ require (
        golang.org/x/build v0.0.0-20240722200705-b9910f320300
        golang.org/x/mod v0.20.0
        golang.org/x/sync v0.8.0
-       golang.org/x/sys v0.23.0
+       golang.org/x/sys v0.26.0
        golang.org/x/telemetry v0.0.0-20240828202201-a797f331ea97
        golang.org/x/term v0.22.1-0.20240716160707-d4346f0be292
        golang.org/x/tools v0.24.1-0.20240904143311-70f56264139c
index 3b9efe242f43e8eda138fd9debcd60d845532e48..631657a6b447a25aa5c1568cf6975d9bc770f910 100644 (file)
@@ -14,8 +14,8 @@ golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
 golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
 golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
 golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
-golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
+golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/telemetry v0.0.0-20240828202201-a797f331ea97 h1:5xPN7d0u5VdgF2gFFXUDaeD3NP1pPgFMHocnCQGAh5M=
 golang.org/x/telemetry v0.0.0-20240828202201-a797f331ea97/go.mod h1:m7R/r+o5h7UvF2JD9n2iLSGY4v8v+zNSyTJ6xynLrqs=
 golang.org/x/term v0.22.1-0.20240716160707-d4346f0be292 h1:BOrQi08eIX3cDgGcMgFONf27MxXigcYa9x+iW5JuCXw=
index 7d3c060e12213c48b017dfd2846fb9b1cf413d31..6e08a76a716e9acd766c9cda4ea56d607b481470 100644 (file)
@@ -156,7 +156,7 @@ from the generated architecture-specific files listed below, and merge these
 into a common file for each OS.
 
 The merge is performed in the following steps:
-1. Construct the set of common code that is idential in all architecture-specific files.
+1. Construct the set of common code that is identical in all architecture-specific files.
 2. Write this common code to the merged file.
 3. Remove the common code from all architecture-specific files.
 
index d07dd09eb503c2d10c6b44da922b0f37566bd8ba..ac54ecaba0a4bbd974659c5562d146424380a139 100644 (file)
@@ -552,6 +552,7 @@ ccflags="$@"
                $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
                $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
                $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
+               $2 ~ /^(CONNECT|SAE)_/ ||
                $2 ~ /^FIORDCHK$/ ||
                $2 ~ /^SIOC/ ||
                $2 ~ /^TIOC/ ||
@@ -655,7 +656,7 @@ errors=$(
 signals=$(
        echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
        awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
-       grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
+       grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
        sort
 )
 
@@ -665,7 +666,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |
        sort >_error.grep
 echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
        awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
-       grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
+       grep -E -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
        sort >_signal.grep
 
 echo '// mkerrors.sh' "$@"
index 67ce6cef2d5c4990629b90eb43d888b90612d671..6f15ba1eaff6571878742b4d058e084f30afa6f2 100644 (file)
@@ -360,7 +360,7 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
        var status _C_int
        var r Pid_t
        err = ERESTART
-       // AIX wait4 may return with ERESTART errno, while the processus is still
+       // AIX wait4 may return with ERESTART errno, while the process is still
        // active.
        for err == ERESTART {
                r, err = wait4(Pid_t(pid), &status, options, rusage)
index 2d15200adb497cc460d26dc8803a21b6d1eef532..099867deedec638201fadb9eb6241893e8761dc3 100644 (file)
@@ -566,6 +566,43 @@ func PthreadFchdir(fd int) (err error) {
        return pthread_fchdir_np(fd)
 }
 
+// Connectx calls connectx(2) to initiate a connection on a socket.
+//
+// srcIf, srcAddr, and dstAddr are filled into a [SaEndpoints] struct and passed as the endpoints argument.
+//
+//   - srcIf is the optional source interface index. 0 means unspecified.
+//   - srcAddr is the optional source address. nil means unspecified.
+//   - dstAddr is the destination address.
+//
+// On success, Connectx returns the number of bytes enqueued for transmission.
+func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocID, flags uint32, iov []Iovec, connid *SaeConnID) (n uintptr, err error) {
+       endpoints := SaEndpoints{
+               Srcif: srcIf,
+       }
+
+       if srcAddr != nil {
+               addrp, addrlen, err := srcAddr.sockaddr()
+               if err != nil {
+                       return 0, err
+               }
+               endpoints.Srcaddr = (*RawSockaddr)(addrp)
+               endpoints.Srcaddrlen = uint32(addrlen)
+       }
+
+       if dstAddr != nil {
+               addrp, addrlen, err := dstAddr.sockaddr()
+               if err != nil {
+                       return 0, err
+               }
+               endpoints.Dstaddr = (*RawSockaddr)(addrp)
+               endpoints.Dstaddrlen = uint32(addrlen)
+       }
+
+       err = connectx(fd, &endpoints, associd, flags, iov, &n, connid)
+       return
+}
+
+//sys  connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
 //sys  sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
 
 //sys  shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
index ba46651f8e38a4aaddbbfc5c3f1de1d006af109e..a6a2d2fc2b90c5c8f0efdb88bb72bc8997400ad9 100644 (file)
@@ -11,6 +11,7 @@ package unix
 int ioctl(int, unsigned long int, uintptr_t);
 */
 import "C"
+import "unsafe"
 
 func ioctl(fd int, req uint, arg uintptr) (err error) {
        r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg))
index 3f1d3d4cb2560b171bd7414fb6cbe6abcac17df6..f08abd434ff479a74567656a2fd01fbc1dc548db 100644 (file)
@@ -1295,6 +1295,48 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
        return &value, err
 }
 
+// GetsockoptTCPCCVegasInfo returns algorithm specific congestion control information for a socket using the "vegas"
+// algorithm.
+//
+// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
+//
+//     algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
+func GetsockoptTCPCCVegasInfo(fd, level, opt int) (*TCPVegasInfo, error) {
+       var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment
+       vallen := _Socklen(SizeofTCPCCInfo)
+       err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
+       out := (*TCPVegasInfo)(unsafe.Pointer(&value[0]))
+       return out, err
+}
+
+// GetsockoptTCPCCDCTCPInfo returns algorithm specific congestion control information for a socket using the "dctp"
+// algorithm.
+//
+// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
+//
+//     algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
+func GetsockoptTCPCCDCTCPInfo(fd, level, opt int) (*TCPDCTCPInfo, error) {
+       var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment
+       vallen := _Socklen(SizeofTCPCCInfo)
+       err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
+       out := (*TCPDCTCPInfo)(unsafe.Pointer(&value[0]))
+       return out, err
+}
+
+// GetsockoptTCPCCBBRInfo returns algorithm specific congestion control information for a socket using the "bbr"
+// algorithm.
+//
+// The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
+//
+//     algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
+func GetsockoptTCPCCBBRInfo(fd, level, opt int) (*TCPBBRInfo, error) {
+       var value [SizeofTCPCCInfo / 4]uint32 // ensure proper alignment
+       vallen := _Socklen(SizeofTCPCCInfo)
+       err := getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
+       out := (*TCPBBRInfo)(unsafe.Pointer(&value[0]))
+       return out, err
+}
+
 // GetsockoptString returns the string value of the socket option opt for the
 // socket associated with fd at the given socket level.
 func GetsockoptString(fd, level, opt int) (string, error) {
@@ -1959,7 +2001,26 @@ func Getpgrp() (pid int) {
 //sysnb        Getpid() (pid int)
 //sysnb        Getppid() (ppid int)
 //sys  Getpriority(which int, who int) (prio int, err error)
-//sys  Getrandom(buf []byte, flags int) (n int, err error)
+
+func Getrandom(buf []byte, flags int) (n int, err error) {
+       vdsoRet, supported := vgetrandom(buf, uint32(flags))
+       if supported {
+               if vdsoRet < 0 {
+                       return 0, errnoErr(syscall.Errno(-vdsoRet))
+               }
+               return vdsoRet, nil
+       }
+       var p *byte
+       if len(buf) > 0 {
+               p = &buf[0]
+       }
+       r, _, e := Syscall(SYS_GETRANDOM, uintptr(unsafe.Pointer(p)), uintptr(len(buf)), uintptr(flags))
+       if e != 0 {
+               return 0, errnoErr(e)
+       }
+       return int(r), nil
+}
+
 //sysnb        Getrusage(who int, rusage *Rusage) (err error)
 //sysnb        Getsid(pid int) (sid int, err error)
 //sysnb        Gettid() (tid int)
index cf2ee6c75ef3d3905f8a6575b00500bc246d483d..745e5c7e6c0d5d6cde926549e394f8c541e7371b 100644 (file)
@@ -182,3 +182,5 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error
        }
        return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
 }
+
+const SYS_FSTATAT = SYS_NEWFSTATAT
index 3d0e98451f8a78933ecf08740b1f6e744f0d627a..dd2262a40799a2cdeb02e40a4526aa8b3533c258 100644 (file)
@@ -214,3 +214,5 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error
        }
        return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
 }
+
+const SYS_FSTATAT = SYS_NEWFSTATAT
index 6f5a288944dfe604dd0f33b5b32e5d91b827c3f1..8cf3670bda630e22ea33151e00c3895c72dda69c 100644 (file)
@@ -187,3 +187,5 @@ func RISCVHWProbe(pairs []RISCVHWProbePairs, set *CPUSet, flags uint) (err error
        }
        return riscvHWProbe(pairs, setSize, set, flags)
 }
+
+const SYS_FSTATAT = SYS_NEWFSTATAT
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/vgetrandom_linux.go b/src/cmd/vendor/golang.org/x/sys/unix/vgetrandom_linux.go
new file mode 100644 (file)
index 0000000..07ac8e0
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build linux && go1.24
+
+package unix
+
+import _ "unsafe"
+
+//go:linkname vgetrandom runtime.vgetrandom
+//go:noescape
+func vgetrandom(p []byte, flags uint32) (ret int, supported bool)
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go b/src/cmd/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go
new file mode 100644 (file)
index 0000000..297e97b
--- /dev/null
@@ -0,0 +1,11 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build !linux || !go1.24
+
+package unix
+
+func vgetrandom(p []byte, flags uint32) (ret int, supported bool) {
+       return -1, false
+}
index 4308ac1772b9fa149be0e641158e67cc34ab55e3..d73c4652e6c549ba5214cbc249eaa72274f6ae4a 100644 (file)
@@ -237,6 +237,9 @@ const (
        CLOCK_UPTIME_RAW_APPROX                 = 0x9
        CLONE_NOFOLLOW                          = 0x1
        CLONE_NOOWNERCOPY                       = 0x2
+       CONNECT_DATA_AUTHENTICATED              = 0x4
+       CONNECT_DATA_IDEMPOTENT                 = 0x2
+       CONNECT_RESUME_ON_READ_WRITE            = 0x1
        CR0                                     = 0x0
        CR1                                     = 0x1000
        CR2                                     = 0x2000
@@ -1265,6 +1268,10 @@ const (
        RTV_SSTHRESH                            = 0x20
        RUSAGE_CHILDREN                         = -0x1
        RUSAGE_SELF                             = 0x0
+       SAE_ASSOCID_ALL                         = 0xffffffff
+       SAE_ASSOCID_ANY                         = 0x0
+       SAE_CONNID_ALL                          = 0xffffffff
+       SAE_CONNID_ANY                          = 0x0
        SCM_CREDS                               = 0x3
        SCM_RIGHTS                              = 0x1
        SCM_TIMESTAMP                           = 0x2
index c8068a7a16900487f318022c268b7e2484770ee2..4a55a400588946f6f5aa4d3c472f146c9fa938a5 100644 (file)
@@ -237,6 +237,9 @@ const (
        CLOCK_UPTIME_RAW_APPROX                 = 0x9
        CLONE_NOFOLLOW                          = 0x1
        CLONE_NOOWNERCOPY                       = 0x2
+       CONNECT_DATA_AUTHENTICATED              = 0x4
+       CONNECT_DATA_IDEMPOTENT                 = 0x2
+       CONNECT_RESUME_ON_READ_WRITE            = 0x1
        CR0                                     = 0x0
        CR1                                     = 0x1000
        CR2                                     = 0x2000
@@ -1265,6 +1268,10 @@ const (
        RTV_SSTHRESH                            = 0x20
        RUSAGE_CHILDREN                         = -0x1
        RUSAGE_SELF                             = 0x0
+       SAE_ASSOCID_ALL                         = 0xffffffff
+       SAE_ASSOCID_ANY                         = 0x0
+       SAE_CONNID_ALL                          = 0xffffffff
+       SAE_CONNID_ANY                          = 0x0
        SCM_CREDS                               = 0x3
        SCM_RIGHTS                              = 0x1
        SCM_TIMESTAMP                           = 0x2
index 01a70b24638e60cde45588ff39ee6bfd1d915a21..de3b462489c0b87f198e59a29f86a7b7fa383ac4 100644 (file)
@@ -495,6 +495,7 @@ const (
        BPF_F_TEST_REG_INVARIANTS                   = 0x80
        BPF_F_TEST_RND_HI32                         = 0x4
        BPF_F_TEST_RUN_ON_CPU                       = 0x1
+       BPF_F_TEST_SKB_CHECKSUM_COMPLETE            = 0x4
        BPF_F_TEST_STATE_FREQ                       = 0x8
        BPF_F_TEST_XDP_LIVE_FRAMES                  = 0x2
        BPF_F_XDP_DEV_BOUND_ONLY                    = 0x40
@@ -1922,6 +1923,7 @@ const (
        MNT_EXPIRE                                  = 0x4
        MNT_FORCE                                   = 0x1
        MNT_ID_REQ_SIZE_VER0                        = 0x18
+       MNT_ID_REQ_SIZE_VER1                        = 0x20
        MODULE_INIT_COMPRESSED_FILE                 = 0x4
        MODULE_INIT_IGNORE_MODVERSIONS              = 0x1
        MODULE_INIT_IGNORE_VERMAGIC                 = 0x2
@@ -2187,7 +2189,7 @@ const (
        NFT_REG_SIZE                                = 0x10
        NFT_REJECT_ICMPX_MAX                        = 0x3
        NFT_RT_MAX                                  = 0x4
-       NFT_SECMARK_CTX_MAXLEN                      = 0x100
+       NFT_SECMARK_CTX_MAXLEN                      = 0x1000
        NFT_SET_MAXNAMELEN                          = 0x100
        NFT_SOCKET_MAX                              = 0x3
        NFT_TABLE_F_MASK                            = 0x7
@@ -2356,9 +2358,11 @@ const (
        PERF_MEM_LVLNUM_IO                          = 0xa
        PERF_MEM_LVLNUM_L1                          = 0x1
        PERF_MEM_LVLNUM_L2                          = 0x2
+       PERF_MEM_LVLNUM_L2_MHB                      = 0x5
        PERF_MEM_LVLNUM_L3                          = 0x3
        PERF_MEM_LVLNUM_L4                          = 0x4
        PERF_MEM_LVLNUM_LFB                         = 0xc
+       PERF_MEM_LVLNUM_MSC                         = 0x6
        PERF_MEM_LVLNUM_NA                          = 0xf
        PERF_MEM_LVLNUM_PMEM                        = 0xe
        PERF_MEM_LVLNUM_RAM                         = 0xd
@@ -2431,6 +2435,7 @@ const (
        PRIO_PGRP                                   = 0x1
        PRIO_PROCESS                                = 0x0
        PRIO_USER                                   = 0x2
+       PROCFS_IOCTL_MAGIC                          = 'f'
        PROC_SUPER_MAGIC                            = 0x9fa0
        PROT_EXEC                                   = 0x4
        PROT_GROWSDOWN                              = 0x1000000
@@ -2933,11 +2938,12 @@ const (
        RUSAGE_SELF                                 = 0x0
        RUSAGE_THREAD                               = 0x1
        RWF_APPEND                                  = 0x10
+       RWF_ATOMIC                                  = 0x40
        RWF_DSYNC                                   = 0x2
        RWF_HIPRI                                   = 0x1
        RWF_NOAPPEND                                = 0x20
        RWF_NOWAIT                                  = 0x8
-       RWF_SUPPORTED                               = 0x3f
+       RWF_SUPPORTED                               = 0x7f
        RWF_SYNC                                    = 0x4
        RWF_WRITE_LIFE_NOT_SET                      = 0x0
        SCHED_BATCH                                 = 0x3
@@ -3210,6 +3216,7 @@ const (
        STATX_ATTR_MOUNT_ROOT                       = 0x2000
        STATX_ATTR_NODUMP                           = 0x40
        STATX_ATTR_VERITY                           = 0x100000
+       STATX_ATTR_WRITE_ATOMIC                     = 0x400000
        STATX_BASIC_STATS                           = 0x7ff
        STATX_BLOCKS                                = 0x400
        STATX_BTIME                                 = 0x800
@@ -3226,6 +3233,7 @@ const (
        STATX_SUBVOL                                = 0x8000
        STATX_TYPE                                  = 0x1
        STATX_UID                                   = 0x8
+       STATX_WRITE_ATOMIC                          = 0x10000
        STATX__RESERVED                             = 0x80000000
        SYNC_FILE_RANGE_WAIT_AFTER                  = 0x4
        SYNC_FILE_RANGE_WAIT_BEFORE                 = 0x1
@@ -3624,6 +3632,7 @@ const (
        XDP_UMEM_PGOFF_COMPLETION_RING              = 0x180000000
        XDP_UMEM_PGOFF_FILL_RING                    = 0x100000000
        XDP_UMEM_REG                                = 0x4
+       XDP_UMEM_TX_METADATA_LEN                    = 0x4
        XDP_UMEM_TX_SW_CSUM                         = 0x2
        XDP_UMEM_UNALIGNED_CHUNK_FLAG               = 0x1
        XDP_USE_NEED_WAKEUP                         = 0x8
index 684a5168dac4e3a9cbc4bb6c0bc3dc8259371f06..8aa6d77c0184ec640481f6702f6d9752aa8ed6d0 100644 (file)
@@ -153,9 +153,14 @@ const (
        NFDBITS                          = 0x20
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index 61d74b592d68647f5ec4daffe64daca8d8ff0870..da428f4253398f660159eb46bd5723fa7d43a62b 100644 (file)
@@ -153,9 +153,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index a28c9e3e893adb63c98bad863878601f8d2ae217..bf45bfec78a531ba8c9a577c63adea802d9a714f 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x20
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index ab5d1fe8ead78b400d50ada17cc0a8c203e166fe..71c67162b737e2d35f0ea3899c3c12417aab23e7 100644 (file)
@@ -154,9 +154,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index c523090e7c17e0ada43acb248c94934f4f29a150..9476628fa02b8534f1c233930edac5dffa04cda5 100644 (file)
@@ -154,9 +154,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index 01e6ea7804b12a83847f59ac0464a0ecfa2f211a..b9e85f3cf0c05e70b31ae098fffb37e55a886eb4 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x20
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index 7aa610b1e717baf92c32d098beeb1df9cd1223fe..a48b68a7647ef83eeac6f5e353836a06d16c9f22 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index 92af771b44a35026dee5c90b4f28aeeacb69762a..ea00e8522a15904fa7a5bd3db7985db86655143b 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index b27ef5e6f11952ba929e6659970c6e55b9ee7d34..91c64687176a9e51798cf0ceaadc661570de4af4 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x20
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index 237a2cefb3e5a27bfb7dc72a560c94495270cbaa..8cbf38d639016a95651312cdb47ebfd7cc8af487 100644 (file)
@@ -152,9 +152,14 @@ const (
        NL3                              = 0x300
        NLDLY                            = 0x300
        NOFLSH                           = 0x80000000
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x4
        ONLCR                            = 0x2
index 4a5c555a36e2bf0383f0094e84e7ced989597391..a2df7341917ec85da05ca8e737c5649e8fab2b55 100644 (file)
@@ -152,9 +152,14 @@ const (
        NL3                              = 0x300
        NLDLY                            = 0x300
        NOFLSH                           = 0x80000000
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x4
        ONLCR                            = 0x2
index a02fb49a5f8adb3a400876aa44fde5e597205050..247913792333186b320b8f8f5a3be497b01f24e5 100644 (file)
@@ -152,9 +152,14 @@ const (
        NL3                              = 0x300
        NLDLY                            = 0x300
        NOFLSH                           = 0x80000000
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x4
        ONLCR                            = 0x2
index e26a7c61b2b6fd8edfaf4feb989e013760c7965d..d265f146ee016c204ac17a28e669ec79dec8f97f 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index c48f7c2103b81350e8af69d8b83cc6fa25d1a7a1..3f2d6443964ff1ee59b02671f37743b9403b2764 100644 (file)
@@ -150,9 +150,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x8008b705
        NS_GET_NSTYPE                    = 0xb703
        NS_GET_OWNER_UID                 = 0xb704
        NS_GET_PARENT                    = 0xb702
+       NS_GET_PID_FROM_PIDNS            = 0x8004b706
+       NS_GET_PID_IN_PIDNS              = 0x8004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x8004b707
+       NS_GET_TGID_IN_PIDNS             = 0x8004b709
        NS_GET_USERNS                    = 0xb701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index ad4b9aace7bb6f7eb581f41398aa987f9436ef3a..5d8b727a1c83771bc80f5087d785e8cbc5e10cfb 100644 (file)
@@ -155,9 +155,14 @@ const (
        NFDBITS                          = 0x40
        NLDLY                            = 0x100
        NOFLSH                           = 0x80
+       NS_GET_MNTNS_ID                  = 0x4008b705
        NS_GET_NSTYPE                    = 0x2000b703
        NS_GET_OWNER_UID                 = 0x2000b704
        NS_GET_PARENT                    = 0x2000b702
+       NS_GET_PID_FROM_PIDNS            = 0x4004b706
+       NS_GET_PID_IN_PIDNS              = 0x4004b708
+       NS_GET_TGID_FROM_PIDNS           = 0x4004b707
+       NS_GET_TGID_IN_PIDNS             = 0x4004b709
        NS_GET_USERNS                    = 0x2000b701
        OLCUC                            = 0x2
        ONLCR                            = 0x4
index da08b2ab3d9390d54c8d8ccdb56eb0b458d7989f..1ec2b1407b1268a1c4d8a5f3bc4c2bdd377f418d 100644 (file)
@@ -581,6 +581,8 @@ const (
        AT_EMPTY_PATH                   = 0x1000
        AT_REMOVEDIR                    = 0x200
        RENAME_NOREPLACE                = 1 << 0
+       ST_RDONLY                       = 1
+       ST_NOSUID                       = 2
 )
 
 const (
index b622533ef2c2b7c62409ff7931076774767f74de..24b346e1a35159624c2f367cc53798dd2e947b57 100644 (file)
@@ -841,6 +841,26 @@ var libc_pthread_fchdir_np_trampoline_addr uintptr
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) {
+       var _p0 unsafe.Pointer
+       if len(iov) > 0 {
+               _p0 = unsafe.Pointer(&iov[0])
+       } else {
+               _p0 = unsafe.Pointer(&_zero)
+       }
+       _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0)
+       if e1 != 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
+var libc_connectx_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
        _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
        if e1 != 0 {
index cfe6646baf230fe4e48c94576b47a755f5e599ce..ebd213100b352196714a7e8dc8af96dd9f0b9997 100644 (file)
@@ -248,6 +248,11 @@ TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
 GLOBL  Â·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
 DATA   Â·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)
 
+TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0
+       JMP     libc_connectx(SB)
+GLOBL  Â·libc_connectx_trampoline_addr(SB), RODATA, $8
+DATA   Â·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB)
+
 TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
        JMP     libc_sendfile(SB)
 GLOBL  Â·libc_sendfile_trampoline_addr(SB), RODATA, $8
index 13f624f69f19d446672db282bab5a12c7f94fae0..824b9c2d5e0e011fe18c26975fda89704fc875b7 100644 (file)
@@ -841,6 +841,26 @@ var libc_pthread_fchdir_np_trampoline_addr uintptr
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) {
+       var _p0 unsafe.Pointer
+       if len(iov) > 0 {
+               _p0 = unsafe.Pointer(&iov[0])
+       } else {
+               _p0 = unsafe.Pointer(&_zero)
+       }
+       _, _, e1 := syscall_syscall9(libc_connectx_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(endpoints)), uintptr(associd), uintptr(flags), uintptr(_p0), uintptr(len(iov)), uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(connid)), 0)
+       if e1 != 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
+var libc_connectx_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_connectx connectx "/usr/lib/libSystem.B.dylib"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
        _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
        if e1 != 0 {
index fe222b75df04f7d52b53c4f3d32f6863170784c0..4f178a229345e3f062c1371b3c36eadbc8e04274 100644 (file)
@@ -248,6 +248,11 @@ TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0
 GLOBL  Â·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8
 DATA   Â·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB)
 
+TEXT libc_connectx_trampoline<>(SB),NOSPLIT,$0-0
+       JMP     libc_connectx(SB)
+GLOBL  Â·libc_connectx_trampoline_addr(SB), RODATA, $8
+DATA   Â·libc_connectx_trampoline_addr(SB)/8, $libc_connectx_trampoline<>(SB)
+
 TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0
        JMP     libc_sendfile(SB)
 GLOBL  Â·libc_sendfile_trampoline_addr(SB), RODATA, $8
index 1bc1a5adb25fde8aae979c74220db4ae26aea523..af30da5578031731efcbdc41618f3e786e4ccc6d 100644 (file)
@@ -971,23 +971,6 @@ func Getpriority(which int, who int) (prio int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Getrandom(buf []byte, flags int) (n int, err error) {
-       var _p0 unsafe.Pointer
-       if len(buf) > 0 {
-               _p0 = unsafe.Pointer(&buf[0])
-       } else {
-               _p0 = unsafe.Pointer(&_zero)
-       }
-       r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
-       n = int(r0)
-       if e1 != 0 {
-               err = errnoErr(e1)
-       }
-       return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
 func Getrusage(who int, rusage *Rusage) (err error) {
        _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
        if e1 != 0 {
index d3e38f681ab0345eac069c79580f7f9cba3d4b7a..f485dbf4565671fd01bc685d7de256cbbac0dee2 100644 (file)
@@ -341,6 +341,7 @@ const (
        SYS_STATX                   = 332
        SYS_IO_PGETEVENTS           = 333
        SYS_RSEQ                    = 334
+       SYS_URETPROBE               = 335
        SYS_PIDFD_SEND_SIGNAL       = 424
        SYS_IO_URING_SETUP          = 425
        SYS_IO_URING_ENTER          = 426
index 6c778c23278f923fc4424265cacc92280877460f..1893e2fe884044dc9724126bf8565ca9fca04748 100644 (file)
@@ -85,7 +85,7 @@ const (
        SYS_SPLICE                  = 76
        SYS_TEE                     = 77
        SYS_READLINKAT              = 78
-       SYS_FSTATAT                 = 79
+       SYS_NEWFSTATAT              = 79
        SYS_FSTAT                   = 80
        SYS_SYNC                    = 81
        SYS_FSYNC                   = 82
index 37281cf51a80bbcae0342a567bad5da4e089d2d6..16a4017da0ab2fbb8868a34cf7e90df9b052577e 100644 (file)
@@ -84,6 +84,8 @@ const (
        SYS_SPLICE                  = 76
        SYS_TEE                     = 77
        SYS_READLINKAT              = 78
+       SYS_NEWFSTATAT              = 79
+       SYS_FSTAT                   = 80
        SYS_SYNC                    = 81
        SYS_FSYNC                   = 82
        SYS_FDATASYNC               = 83
index 9889f6a5591b62a375a69a718b692bcb4328852b..a5459e766f59dbfbd2751e1ecc5f7f1c4561bfb4 100644 (file)
@@ -84,7 +84,7 @@ const (
        SYS_SPLICE                  = 76
        SYS_TEE                     = 77
        SYS_READLINKAT              = 78
-       SYS_FSTATAT                 = 79
+       SYS_NEWFSTATAT              = 79
        SYS_FSTAT                   = 80
        SYS_SYNC                    = 81
        SYS_FSYNC                   = 82
index 091d107f3a5c98255250449074b23e36885b256d..d003c3d43780c22bca92bd9426dc7e88bf7b8fb1 100644 (file)
@@ -306,6 +306,19 @@ type XVSockPgen struct {
 
 type _Socklen uint32
 
+type SaeAssocID uint32
+
+type SaeConnID uint32
+
+type SaEndpoints struct {
+       Srcif      uint32
+       Srcaddr    *RawSockaddr
+       Srcaddrlen uint32
+       Dstaddr    *RawSockaddr
+       Dstaddrlen uint32
+       _          [4]byte
+}
+
 type Xucred struct {
        Version uint32
        Uid     uint32
index 28ff4ef74d0d3e2769e75b79c0b757fc3837a13e..0d45a941aaeccff1f29ca0bcfe667984a58f46d0 100644 (file)
@@ -306,6 +306,19 @@ type XVSockPgen struct {
 
 type _Socklen uint32
 
+type SaeAssocID uint32
+
+type SaeConnID uint32
+
+type SaEndpoints struct {
+       Srcif      uint32
+       Srcaddr    *RawSockaddr
+       Srcaddrlen uint32
+       Dstaddr    *RawSockaddr
+       Dstaddrlen uint32
+       _          [4]byte
+}
+
 type Xucred struct {
        Version uint32
        Uid     uint32
index 6cbd094a3aa19eaf6dfdbddac0d63276bd7ffa79..51e13eb055fc5b6b11c1c6ec83bce47610faffa3 100644 (file)
@@ -625,6 +625,7 @@ const (
        POLLRDNORM   = 0x40
        POLLWRBAND   = 0x100
        POLLWRNORM   = 0x4
+       POLLRDHUP    = 0x4000
 )
 
 type CapRights struct {
index 7c03b6ee77fa0839d25c0d67debf11a4555b703c..d002d8ef3cc2d79cef3f0afee8d25c22632d994f 100644 (file)
@@ -630,6 +630,7 @@ const (
        POLLRDNORM   = 0x40
        POLLWRBAND   = 0x100
        POLLWRNORM   = 0x4
+       POLLRDHUP    = 0x4000
 )
 
 type CapRights struct {
index 422107ee8b1331d85b7ab4b18a1b8846d1dcc793..3f863d898dd8520433d3201e92b4b318e0a0337a 100644 (file)
@@ -616,6 +616,7 @@ const (
        POLLRDNORM   = 0x40
        POLLWRBAND   = 0x100
        POLLWRNORM   = 0x4
+       POLLRDHUP    = 0x4000
 )
 
 type CapRights struct {
index 505a12acfd9d2951064f4d98572f7f3313109ee9..61c7293106616f197b93c1f86f3fb9d599a25f14 100644 (file)
@@ -610,6 +610,7 @@ const (
        POLLRDNORM   = 0x40
        POLLWRBAND   = 0x100
        POLLWRNORM   = 0x4
+       POLLRDHUP    = 0x4000
 )
 
 type CapRights struct {
index cc986c7900660055f809096adc8112e208acca37..b5d17414f039f90f084edaf771bfb3b3c96c15b0 100644 (file)
@@ -612,6 +612,7 @@ const (
        POLLRDNORM   = 0x40
        POLLWRBAND   = 0x100
        POLLWRNORM   = 0x4
+       POLLRDHUP    = 0x4000
 )
 
 type CapRights struct {
index b102b95a0a19db8ad7f47ef4c4f7a0d9d8a69100..3a69e4549626895e42649743d5a21d9d19671f1e 100644 (file)
@@ -87,31 +87,35 @@ type StatxTimestamp struct {
 }
 
 type Statx_t struct {
-       Mask             uint32
-       Blksize          uint32
-       Attributes       uint64
-       Nlink            uint32
-       Uid              uint32
-       Gid              uint32
-       Mode             uint16
-       _                [1]uint16
-       Ino              uint64
-       Size             uint64
-       Blocks           uint64
-       Attributes_mask  uint64
-       Atime            StatxTimestamp
-       Btime            StatxTimestamp
-       Ctime            StatxTimestamp
-       Mtime            StatxTimestamp
-       Rdev_major       uint32
-       Rdev_minor       uint32
-       Dev_major        uint32
-       Dev_minor        uint32
-       Mnt_id           uint64
-       Dio_mem_align    uint32
-       Dio_offset_align uint32
-       Subvol           uint64
-       _                [11]uint64
+       Mask                      uint32
+       Blksize                   uint32
+       Attributes                uint64
+       Nlink                     uint32
+       Uid                       uint32
+       Gid                       uint32
+       Mode                      uint16
+       _                         [1]uint16
+       Ino                       uint64
+       Size                      uint64
+       Blocks                    uint64
+       Attributes_mask           uint64
+       Atime                     StatxTimestamp
+       Btime                     StatxTimestamp
+       Ctime                     StatxTimestamp
+       Mtime                     StatxTimestamp
+       Rdev_major                uint32
+       Rdev_minor                uint32
+       Dev_major                 uint32
+       Dev_minor                 uint32
+       Mnt_id                    uint64
+       Dio_mem_align             uint32
+       Dio_offset_align          uint32
+       Subvol                    uint64
+       Atomic_write_unit_min     uint32
+       Atomic_write_unit_max     uint32
+       Atomic_write_segments_max uint32
+       _                         [1]uint32
+       _                         [9]uint64
 }
 
 type Fsid struct {
@@ -516,6 +520,29 @@ type TCPInfo struct {
        Total_rto_time       uint32
 }
 
+type TCPVegasInfo struct {
+       Enabled uint32
+       Rttcnt  uint32
+       Rtt     uint32
+       Minrtt  uint32
+}
+
+type TCPDCTCPInfo struct {
+       Enabled  uint16
+       Ce_state uint16
+       Alpha    uint32
+       Ab_ecn   uint32
+       Ab_tot   uint32
+}
+
+type TCPBBRInfo struct {
+       Bw_lo       uint32
+       Bw_hi       uint32
+       Min_rtt     uint32
+       Pacing_gain uint32
+       Cwnd_gain   uint32
+}
+
 type CanFilter struct {
        Id   uint32
        Mask uint32
@@ -557,6 +584,7 @@ const (
        SizeofICMPv6Filter      = 0x20
        SizeofUcred             = 0xc
        SizeofTCPInfo           = 0xf8
+       SizeofTCPCCInfo         = 0x14
        SizeofCanFilter         = 0x8
        SizeofTCPRepairOpt      = 0x8
 )
@@ -2486,7 +2514,7 @@ type XDPMmapOffsets struct {
 type XDPUmemReg struct {
        Addr            uint64
        Len             uint64
-       Chunk_size      uint32
+       Size            uint32
        Headroom        uint32
        Flags           uint32
        Tx_metadata_len uint32
@@ -3766,7 +3794,7 @@ const (
        ETHTOOL_MSG_PSE_GET                       = 0x24
        ETHTOOL_MSG_PSE_SET                       = 0x25
        ETHTOOL_MSG_RSS_GET                       = 0x26
-       ETHTOOL_MSG_USER_MAX                      = 0x2b
+       ETHTOOL_MSG_USER_MAX                      = 0x2c
        ETHTOOL_MSG_KERNEL_NONE                   = 0x0
        ETHTOOL_MSG_STRSET_GET_REPLY              = 0x1
        ETHTOOL_MSG_LINKINFO_GET_REPLY            = 0x2
@@ -3806,7 +3834,10 @@ const (
        ETHTOOL_MSG_MODULE_NTF                    = 0x24
        ETHTOOL_MSG_PSE_GET_REPLY                 = 0x25
        ETHTOOL_MSG_RSS_GET_REPLY                 = 0x26
-       ETHTOOL_MSG_KERNEL_MAX                    = 0x2b
+       ETHTOOL_MSG_KERNEL_MAX                    = 0x2c
+       ETHTOOL_FLAG_COMPACT_BITSETS              = 0x1
+       ETHTOOL_FLAG_OMIT_REPLY                   = 0x2
+       ETHTOOL_FLAG_STATS                        = 0x4
        ETHTOOL_A_HEADER_UNSPEC                   = 0x0
        ETHTOOL_A_HEADER_DEV_INDEX                = 0x1
        ETHTOOL_A_HEADER_DEV_NAME                 = 0x2
@@ -3948,7 +3979,7 @@ const (
        ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL   = 0x17
        ETHTOOL_A_COALESCE_USE_CQE_MODE_TX        = 0x18
        ETHTOOL_A_COALESCE_USE_CQE_MODE_RX        = 0x19
-       ETHTOOL_A_COALESCE_MAX                    = 0x1c
+       ETHTOOL_A_COALESCE_MAX                    = 0x1e
        ETHTOOL_A_PAUSE_UNSPEC                    = 0x0
        ETHTOOL_A_PAUSE_HEADER                    = 0x1
        ETHTOOL_A_PAUSE_AUTONEG                   = 0x2
@@ -4606,7 +4637,7 @@ const (
        NL80211_ATTR_MAC_HINT                                   = 0xc8
        NL80211_ATTR_MAC_MASK                                   = 0xd7
        NL80211_ATTR_MAX_AP_ASSOC_STA                           = 0xca
-       NL80211_ATTR_MAX                                        = 0x14a
+       NL80211_ATTR_MAX                                        = 0x14c
        NL80211_ATTR_MAX_CRIT_PROT_DURATION                     = 0xb4
        NL80211_ATTR_MAX_CSA_COUNTERS                           = 0xce
        NL80211_ATTR_MAX_MATCH_SETS                             = 0x85
@@ -5210,7 +5241,7 @@ const (
        NL80211_FREQUENCY_ATTR_GO_CONCURRENT                    = 0xf
        NL80211_FREQUENCY_ATTR_INDOOR_ONLY                      = 0xe
        NL80211_FREQUENCY_ATTR_IR_CONCURRENT                    = 0xf
-       NL80211_FREQUENCY_ATTR_MAX                              = 0x20
+       NL80211_FREQUENCY_ATTR_MAX                              = 0x21
        NL80211_FREQUENCY_ATTR_MAX_TX_POWER                     = 0x6
        NL80211_FREQUENCY_ATTR_NO_10MHZ                         = 0x11
        NL80211_FREQUENCY_ATTR_NO_160MHZ                        = 0xc
index 15adc04142f2b5a8cd2248839c4732b07626f53e..ad05b51a60364994ecb52341160202a800f98ddc 100644 (file)
@@ -727,6 +727,37 @@ const (
        RISCV_HWPROBE_EXT_ZBA                = 0x8
        RISCV_HWPROBE_EXT_ZBB                = 0x10
        RISCV_HWPROBE_EXT_ZBS                = 0x20
+       RISCV_HWPROBE_EXT_ZICBOZ             = 0x40
+       RISCV_HWPROBE_EXT_ZBC                = 0x80
+       RISCV_HWPROBE_EXT_ZBKB               = 0x100
+       RISCV_HWPROBE_EXT_ZBKC               = 0x200
+       RISCV_HWPROBE_EXT_ZBKX               = 0x400
+       RISCV_HWPROBE_EXT_ZKND               = 0x800
+       RISCV_HWPROBE_EXT_ZKNE               = 0x1000
+       RISCV_HWPROBE_EXT_ZKNH               = 0x2000
+       RISCV_HWPROBE_EXT_ZKSED              = 0x4000
+       RISCV_HWPROBE_EXT_ZKSH               = 0x8000
+       RISCV_HWPROBE_EXT_ZKT                = 0x10000
+       RISCV_HWPROBE_EXT_ZVBB               = 0x20000
+       RISCV_HWPROBE_EXT_ZVBC               = 0x40000
+       RISCV_HWPROBE_EXT_ZVKB               = 0x80000
+       RISCV_HWPROBE_EXT_ZVKG               = 0x100000
+       RISCV_HWPROBE_EXT_ZVKNED             = 0x200000
+       RISCV_HWPROBE_EXT_ZVKNHA             = 0x400000
+       RISCV_HWPROBE_EXT_ZVKNHB             = 0x800000
+       RISCV_HWPROBE_EXT_ZVKSED             = 0x1000000
+       RISCV_HWPROBE_EXT_ZVKSH              = 0x2000000
+       RISCV_HWPROBE_EXT_ZVKT               = 0x4000000
+       RISCV_HWPROBE_EXT_ZFH                = 0x8000000
+       RISCV_HWPROBE_EXT_ZFHMIN             = 0x10000000
+       RISCV_HWPROBE_EXT_ZIHINTNTL          = 0x20000000
+       RISCV_HWPROBE_EXT_ZVFH               = 0x40000000
+       RISCV_HWPROBE_EXT_ZVFHMIN            = 0x80000000
+       RISCV_HWPROBE_EXT_ZFA                = 0x100000000
+       RISCV_HWPROBE_EXT_ZTSO               = 0x200000000
+       RISCV_HWPROBE_EXT_ZACAS              = 0x400000000
+       RISCV_HWPROBE_EXT_ZICOND             = 0x800000000
+       RISCV_HWPROBE_EXT_ZIHINTPAUSE        = 0x1000000000
        RISCV_HWPROBE_KEY_CPUPERF_0          = 0x5
        RISCV_HWPROBE_MISALIGNED_UNKNOWN     = 0x0
        RISCV_HWPROBE_MISALIGNED_EMULATED    = 0x1
@@ -734,4 +765,6 @@ const (
        RISCV_HWPROBE_MISALIGNED_FAST        = 0x3
        RISCV_HWPROBE_MISALIGNED_UNSUPPORTED = 0x4
        RISCV_HWPROBE_MISALIGNED_MASK        = 0x7
+       RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE  = 0x6
+       RISCV_HWPROBE_WHICH_CPUS             = 0x1
 )
index 115341fba66dab28536543805dbbdfd3a88500a1..4e613cf6335ceaaaf3075e177938ef11688461a4 100644 (file)
@@ -65,7 +65,7 @@ func LoadDLL(name string) (dll *DLL, err error) {
        return d, nil
 }
 
-// MustLoadDLL is like LoadDLL but panics if load operation failes.
+// MustLoadDLL is like LoadDLL but panics if load operation fails.
 func MustLoadDLL(name string) *DLL {
        d, e := LoadDLL(name)
        if e != nil {
index 1fa34fd17c5cd9ff9fe76b0023f957c642caae32..5cee9a3143fd5e426980d338925943c4baf862f0 100644 (file)
@@ -313,6 +313,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
 //sys  SetConsoleMode(console Handle, mode uint32) (err error) = kernel32.SetConsoleMode
 //sys  GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) = kernel32.GetConsoleScreenBufferInfo
 //sys  setConsoleCursorPosition(console Handle, position uint32) (err error) = kernel32.SetConsoleCursorPosition
+//sys  GetConsoleCP() (cp uint32, err error) = kernel32.GetConsoleCP
+//sys  GetConsoleOutputCP() (cp uint32, err error) = kernel32.GetConsoleOutputCP
+//sys  SetConsoleCP(cp uint32) (err error) = kernel32.SetConsoleCP
+//sys  SetConsoleOutputCP(cp uint32) (err error) = kernel32.SetConsoleOutputCP
 //sys  WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) = kernel32.WriteConsoleW
 //sys  ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) = kernel32.ReadConsoleW
 //sys  resizePseudoConsole(pconsole Handle, size uint32) (hr error) = kernel32.ResizePseudoConsole
index 4d0c15745f89f22eb4b115b068003ee123d5f19c..7b97a154c9573134f0dfea736baff89b43a586cf 100644 (file)
@@ -1060,6 +1060,7 @@ const (
        SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6
        SIO_KEEPALIVE_VALS                 = IOC_IN | IOC_VENDOR | 4
        SIO_UDP_CONNRESET                  = IOC_IN | IOC_VENDOR | 12
+       SIO_UDP_NETRESET                   = IOC_IN | IOC_VENDOR | 15
 
        // cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460
 
@@ -2031,6 +2032,50 @@ const (
        IF_TYPE_IEEE1394           = 144
 )
 
+// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin
+const (
+       IpPrefixOriginOther               = 0
+       IpPrefixOriginManual              = 1
+       IpPrefixOriginWellKnown           = 2
+       IpPrefixOriginDhcp                = 3
+       IpPrefixOriginRouterAdvertisement = 4
+       IpPrefixOriginUnchanged           = 1 << 4
+)
+
+// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin
+const (
+       NlsoOther                      = 0
+       NlsoManual                     = 1
+       NlsoWellKnown                  = 2
+       NlsoDhcp                       = 3
+       NlsoLinkLayerAddress           = 4
+       NlsoRandom                     = 5
+       IpSuffixOriginOther            = 0
+       IpSuffixOriginManual           = 1
+       IpSuffixOriginWellKnown        = 2
+       IpSuffixOriginDhcp             = 3
+       IpSuffixOriginLinkLayerAddress = 4
+       IpSuffixOriginRandom           = 5
+       IpSuffixOriginUnchanged        = 1 << 4
+)
+
+// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see
+// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state
+const (
+       NldsInvalid          = 0
+       NldsTentative        = 1
+       NldsDuplicate        = 2
+       NldsDeprecated       = 3
+       NldsPreferred        = 4
+       IpDadStateInvalid    = 0
+       IpDadStateTentative  = 1
+       IpDadStateDuplicate  = 2
+       IpDadStateDeprecated = 3
+       IpDadStatePreferred  = 4
+)
+
 type SocketAddress struct {
        Sockaddr       *syscall.RawSockaddrAny
        SockaddrLength int32
index 9bb979a3e47267f14e699cc5cd5b9d8376b7aaa6..4c2e1bdc01ed38e77449c8e91766d02dc9940fce 100644 (file)
@@ -247,7 +247,9 @@ var (
        procGetCommandLineW                                      = modkernel32.NewProc("GetCommandLineW")
        procGetComputerNameExW                                   = modkernel32.NewProc("GetComputerNameExW")
        procGetComputerNameW                                     = modkernel32.NewProc("GetComputerNameW")
+       procGetConsoleCP                                         = modkernel32.NewProc("GetConsoleCP")
        procGetConsoleMode                                       = modkernel32.NewProc("GetConsoleMode")
+       procGetConsoleOutputCP                                   = modkernel32.NewProc("GetConsoleOutputCP")
        procGetConsoleScreenBufferInfo                           = modkernel32.NewProc("GetConsoleScreenBufferInfo")
        procGetCurrentDirectoryW                                 = modkernel32.NewProc("GetCurrentDirectoryW")
        procGetCurrentProcessId                                  = modkernel32.NewProc("GetCurrentProcessId")
@@ -347,8 +349,10 @@ var (
        procSetCommMask                                          = modkernel32.NewProc("SetCommMask")
        procSetCommState                                         = modkernel32.NewProc("SetCommState")
        procSetCommTimeouts                                      = modkernel32.NewProc("SetCommTimeouts")
+       procSetConsoleCP                                         = modkernel32.NewProc("SetConsoleCP")
        procSetConsoleCursorPosition                             = modkernel32.NewProc("SetConsoleCursorPosition")
        procSetConsoleMode                                       = modkernel32.NewProc("SetConsoleMode")
+       procSetConsoleOutputCP                                   = modkernel32.NewProc("SetConsoleOutputCP")
        procSetCurrentDirectoryW                                 = modkernel32.NewProc("SetCurrentDirectoryW")
        procSetDefaultDllDirectories                             = modkernel32.NewProc("SetDefaultDllDirectories")
        procSetDllDirectoryW                                     = modkernel32.NewProc("SetDllDirectoryW")
@@ -2162,6 +2166,15 @@ func GetComputerName(buf *uint16, n *uint32) (err error) {
        return
 }
 
+func GetConsoleCP() (cp uint32, err error) {
+       r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0)
+       cp = uint32(r0)
+       if cp == 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
 func GetConsoleMode(console Handle, mode *uint32) (err error) {
        r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0)
        if r1 == 0 {
@@ -2170,6 +2183,15 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) {
        return
 }
 
+func GetConsoleOutputCP() (cp uint32, err error) {
+       r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0)
+       cp = uint32(r0)
+       if cp == 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
 func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) {
        r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0)
        if r1 == 0 {
@@ -3038,6 +3060,14 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) {
        return
 }
 
+func SetConsoleCP(cp uint32) (err error) {
+       r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0)
+       if r1 == 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
 func setConsoleCursorPosition(console Handle, position uint32) (err error) {
        r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0)
        if r1 == 0 {
@@ -3054,6 +3084,14 @@ func SetConsoleMode(console Handle, mode uint32) (err error) {
        return
 }
 
+func SetConsoleOutputCP(cp uint32) (err error) {
+       r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0)
+       if r1 == 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
 func SetCurrentDirectory(path *uint16) (err error) {
        r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
        if r1 == 0 {
index 9ef02f144f85ab862121b69c9cdb64e71c410811..76e81b3e53b031d7acdd9783cc1d69138151e51f 100644 (file)
@@ -43,7 +43,7 @@ golang.org/x/mod/zip
 ## explicit; go 1.18
 golang.org/x/sync/errgroup
 golang.org/x/sync/semaphore
-# golang.org/x/sys v0.23.0
+# golang.org/x/sys v0.26.0
 ## explicit; go 1.18
 golang.org/x/sys/plan9
 golang.org/x/sys/unix
index df27f25e789f05e7798f5b58d59078507d18e773..b17c58acccbd0068c8ab92eb2d63f2f69b8f62b4 100644 (file)
@@ -8,6 +8,6 @@ require (
 )
 
 require (
-       golang.org/x/sys v0.23.0 // indirect
+       golang.org/x/sys v0.26.0 // indirect
        golang.org/x/text v0.16.1-0.20240716160804-ae0cf96bbcd9 // indirect
 )
index b4efd6d3c50c117df6984ce12116408662e5fb29..6d6fc679364eae50af203b5be44052588bb6f9e5 100644 (file)
@@ -2,7 +2,7 @@ golang.org/x/crypto v0.25.1-0.20240722173533-bb80217080b0 h1:wxHbFWyu21uEPJJnYaS
 golang.org/x/crypto v0.25.1-0.20240722173533-bb80217080b0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
 golang.org/x/net v0.27.1-0.20240722181819-765c7e89b3bd h1:pHzwejE8Zkb94bG4nA+fUeskKPFp1HPldrhv62dabro=
 golang.org/x/net v0.27.1-0.20240722181819-765c7e89b3bd/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
-golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
-golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
+golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 golang.org/x/text v0.16.1-0.20240716160804-ae0cf96bbcd9 h1:MlCLrwVF1WvXT14xTzwuKN3u4LpUve8sG/gJUCuBpe8=
 golang.org/x/text v0.16.1-0.20240716160804-ae0cf96bbcd9/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
index ec07aab05788c8732bee74fc3837f5b188ae4c84..02609d5b21d56a5b82ce169a3bd1f933f9d091f3 100644 (file)
@@ -201,6 +201,25 @@ var S390X struct {
        _         CacheLinePad
 }
 
+// RISCV64 contains the supported CPU features and performance characteristics for riscv64
+// platforms. The booleans in RISCV64, with the exception of HasFastMisaligned, indicate
+// the presence of RISC-V extensions.
+//
+// It is safe to assume that all the RV64G extensions are supported and so they are omitted from
+// this structure. As riscv64 Go programs require at least RV64G, the code that populates
+// this structure cannot run successfully if some of the RV64G extensions are missing.
+// The struct is padded to avoid false sharing.
+var RISCV64 struct {
+       _                 CacheLinePad
+       HasFastMisaligned bool // Fast misaligned accesses
+       HasC              bool // Compressed instruction-set extension
+       HasV              bool // Vector extension compatible with RVV 1.0
+       HasZba            bool // Address generation instructions extension
+       HasZbb            bool // Basic bit-manipulation extension
+       HasZbs            bool // Single-bit instructions extension
+       _                 CacheLinePad
+}
+
 func init() {
        archInit()
        initOptions()
index cd63e73355734ca8a12f992c5db23c002a0b6166..7d902b6847bbf90526eb980e09039a79cebcceda 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
+//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64
 
 package cpu
 
diff --git a/src/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/src/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go
new file mode 100644 (file)
index 0000000..cb4a0c5
--- /dev/null
@@ -0,0 +1,137 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+import (
+       "syscall"
+       "unsafe"
+)
+
+// RISC-V extension discovery code for Linux. The approach here is to first try the riscv_hwprobe
+// syscall falling back to HWCAP to check for the C extension if riscv_hwprobe is not available.
+//
+// A note on detection of the Vector extension using HWCAP.
+//
+// Support for the Vector extension version 1.0 was added to the Linux kernel in release 6.5.
+// Support for the riscv_hwprobe syscall was added in 6.4. It follows that if the riscv_hwprobe
+// syscall is not available then neither is the Vector extension (which needs kernel support).
+// The riscv_hwprobe syscall should then be all we need to detect the Vector extension.
+// However, some RISC-V board manufacturers ship boards with an older kernel on top of which
+// they have back-ported various versions of the Vector extension patches but not the riscv_hwprobe
+// patches. These kernels advertise support for the Vector extension using HWCAP. Falling
+// back to HWCAP to detect the Vector extension, if riscv_hwprobe is not available, or simply not
+// bothering with riscv_hwprobe at all and just using HWCAP may then seem like an attractive option.
+//
+// Unfortunately, simply checking the 'V' bit in AT_HWCAP will not work as this bit is used by
+// RISC-V board and cloud instance providers to mean different things. The Lichee Pi 4A board
+// and the Scaleway RV1 cloud instances use the 'V' bit to advertise their support for the unratified
+// 0.7.1 version of the Vector Specification. The Banana Pi BPI-F3 and the CanMV-K230 board use
+// it to advertise support for 1.0 of the Vector extension. Versions 0.7.1 and 1.0 of the Vector
+// extension are binary incompatible. HWCAP can then not be used in isolation to populate the
+// HasV field as this field indicates that the underlying CPU is compatible with RVV 1.0.
+//
+// There is a way at runtime to distinguish between versions 0.7.1 and 1.0 of the Vector
+// specification by issuing a RVV 1.0 vsetvli instruction and checking the vill bit of the vtype
+// register. This check would allow us to safely detect version 1.0 of the Vector extension
+// with HWCAP, if riscv_hwprobe were not available. However, the check cannot
+// be added until the assembler supports the Vector instructions.
+//
+// Note the riscv_hwprobe syscall does not suffer from these ambiguities by design as all of the
+// extensions it advertises support for are explicitly versioned. It's also worth noting that
+// the riscv_hwprobe syscall is the only way to detect multi-letter RISC-V extensions, e.g., Zba.
+// These cannot be detected using HWCAP and so riscv_hwprobe must be used to detect the majority
+// of RISC-V extensions.
+//
+// Please see https://docs.kernel.org/arch/riscv/hwprobe.html for more information.
+
+// golang.org/x/sys/cpu is not allowed to depend on golang.org/x/sys/unix so we must
+// reproduce the constants, types and functions needed to make the riscv_hwprobe syscall
+// here.
+
+const (
+       // Copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go.
+       riscv_HWPROBE_KEY_IMA_EXT_0   = 0x4
+       riscv_HWPROBE_IMA_C           = 0x2
+       riscv_HWPROBE_IMA_V           = 0x4
+       riscv_HWPROBE_EXT_ZBA         = 0x8
+       riscv_HWPROBE_EXT_ZBB         = 0x10
+       riscv_HWPROBE_EXT_ZBS         = 0x20
+       riscv_HWPROBE_KEY_CPUPERF_0   = 0x5
+       riscv_HWPROBE_MISALIGNED_FAST = 0x3
+       riscv_HWPROBE_MISALIGNED_MASK = 0x7
+)
+
+const (
+       // sys_RISCV_HWPROBE is copied from golang.org/x/sys/unix/zsysnum_linux_riscv64.go.
+       sys_RISCV_HWPROBE = 258
+)
+
+// riscvHWProbePairs is copied from golang.org/x/sys/unix/ztypes_linux_riscv64.go.
+type riscvHWProbePairs struct {
+       key   int64
+       value uint64
+}
+
+const (
+       // CPU features
+       hwcap_RISCV_ISA_C = 1 << ('C' - 'A')
+)
+
+func doinit() {
+       // A slice of key/value pair structures is passed to the RISCVHWProbe syscall. The key
+       // field should be initialised with one of the key constants defined above, e.g.,
+       // RISCV_HWPROBE_KEY_IMA_EXT_0. The syscall will set the value field to the appropriate value.
+       // If the kernel does not recognise a key it will set the key field to -1 and the value field to 0.
+
+       pairs := []riscvHWProbePairs{
+               {riscv_HWPROBE_KEY_IMA_EXT_0, 0},
+               {riscv_HWPROBE_KEY_CPUPERF_0, 0},
+       }
+
+       // This call only indicates that extensions are supported if they are implemented on all cores.
+       if riscvHWProbe(pairs, 0) {
+               if pairs[0].key != -1 {
+                       v := uint(pairs[0].value)
+                       RISCV64.HasC = isSet(v, riscv_HWPROBE_IMA_C)
+                       RISCV64.HasV = isSet(v, riscv_HWPROBE_IMA_V)
+                       RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA)
+                       RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB)
+                       RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS)
+               }
+               if pairs[1].key != -1 {
+                       v := pairs[1].value & riscv_HWPROBE_MISALIGNED_MASK
+                       RISCV64.HasFastMisaligned = v == riscv_HWPROBE_MISALIGNED_FAST
+               }
+       }
+
+       // Let's double check with HWCAP if the C extension does not appear to be supported.
+       // This may happen if we're running on a kernel older than 6.4.
+
+       if !RISCV64.HasC {
+               RISCV64.HasC = isSet(hwCap, hwcap_RISCV_ISA_C)
+       }
+}
+
+func isSet(hwc uint, value uint) bool {
+       return hwc&value != 0
+}
+
+// riscvHWProbe is a simplified version of the generated wrapper function found in
+// golang.org/x/sys/unix/zsyscall_linux_riscv64.go. We simplify it by removing the
+// cpuCount and cpus parameters which we do not need. We always want to pass 0 for
+// these parameters here so the kernel only reports the extensions that are present
+// on all cores.
+func riscvHWProbe(pairs []riscvHWProbePairs, flags uint) bool {
+       var _zero uintptr
+       var p0 unsafe.Pointer
+       if len(pairs) > 0 {
+               p0 = unsafe.Pointer(&pairs[0])
+       } else {
+               p0 = unsafe.Pointer(&_zero)
+       }
+
+       _, _, e1 := syscall.Syscall6(sys_RISCV_HWPROBE, uintptr(p0), uintptr(len(pairs)), uintptr(0), uintptr(0), uintptr(flags), 0)
+       return e1 == 0
+}
index 7f0c79c004b44a57b821bdf405363148da434314..aca3199c911690b3b2899e2ee373083e2ac66cdd 100644 (file)
@@ -8,4 +8,13 @@ package cpu
 
 const cacheLineSize = 64
 
-func initOptions() {}
+func initOptions() {
+       options = []option{
+               {Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned},
+               {Name: "c", Feature: &RISCV64.HasC},
+               {Name: "v", Feature: &RISCV64.HasV},
+               {Name: "zba", Feature: &RISCV64.HasZba},
+               {Name: "zbb", Feature: &RISCV64.HasZbb},
+               {Name: "zbs", Feature: &RISCV64.HasZbs},
+       }
+}
index cf5c0b83c9eeef9e922c2cb141bcabec1b85ae2d..bb1d1c15c3857464b7a510b00b4e8bd27889d78b 100644 (file)
@@ -18,7 +18,7 @@ golang.org/x/net/idna
 golang.org/x/net/lif
 golang.org/x/net/nettest
 golang.org/x/net/route
-# golang.org/x/sys v0.23.0
+# golang.org/x/sys v0.26.0
 ## explicit; go 1.18
 golang.org/x/sys/cpu
 # golang.org/x/text v0.16.1-0.20240716160804-ae0cf96bbcd9