diff options
Diffstat (limited to 'src/syscall/syscall_openbsd_libc.go')
-rw-r--r-- | src/syscall/syscall_openbsd_libc.go | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/syscall/syscall_openbsd_libc.go b/src/syscall/syscall_openbsd_libc.go index ddf62f4d3f..5dea268c3e 100644 --- a/src/syscall/syscall_openbsd_libc.go +++ b/src/syscall/syscall_openbsd_libc.go @@ -16,26 +16,40 @@ func init() { execveOpenBSD = execve } -//sys directSyscall(trap uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr) (ret uintptr, err error) = SYS_syscall - func syscallInternal(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { - return syscall6X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, 0, 0) + // OpenBSD 7.5+ no longer supports indirect syscalls. A number of Go + // packages make use of syscall.Syscall with SYS_IOCTL since it is + // not well supported by golang.org/x/sys/unix. Reroute this system + // call number to the respective libc stub so that it continues to + // work for the time being. See #63900 for further details. + if trap == SYS_IOCTL { + return syscallX(abi.FuncPCABI0(libc_ioctl_trampoline), a1, a2, a3) + } + return 0, 0, ENOSYS } func syscall6Internal(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { - return syscall10X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) + // OpenBSD 7.5+ no longer supports indirect syscalls. A number of Go + // packages make use of syscall.Syscall with SYS___SYSCTL since it is + // not well supported by golang.org/x/sys/unix. Reroute this system + // call number to the respective libc stub so that it continues to + // work for the time being. See #63900 for further details. + if trap == SYS___SYSCTL { + return syscall6X(abi.FuncPCABI0(libc_sysctl_trampoline), a1, a2, a3, a4, a5, a6) + } + return 0, 0, ENOSYS } func rawSyscallInternal(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) { - return rawSyscall6X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, 0, 0) + return 0, 0, ENOSYS } func rawSyscall6Internal(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) { - return rawSyscall10X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) + return 0, 0, ENOSYS } func syscall9Internal(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { - return rawSyscall10X(abi.FuncPCABI0(libc_syscall_trampoline), trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) + return 0, 0, ENOSYS } // Implemented in the runtime package (runtime/sys_openbsd3.go) |