mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
The current code has continued to work on OpenBSD, since it has been using syscall(2) via libc. However, the system call numbers are still hardcoded in golang.org/x/sys/unix. Various system call changes have been made in OpenBSD, resulting in changes to the system call numbers and arguments, which now fail when this package is used. Switch to calling various system calls directly via libc, rather than calling via libc using syscall(2). Updates golang/go#36435 Change-Id: If8e403f0fda7a8b68da71c1f4efba7785b14edf5 Reviewed-on: https://go-review.googlesource.com/c/sys/+/421800 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
// Copyright 2022 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 (openbsd && 386) || (openbsd && amd64) || (openbsd && arm) || (openbsd && arm64)
|
|
// +build openbsd,386 openbsd,amd64 openbsd,arm openbsd,arm64
|
|
|
|
package unix
|
|
|
|
import _ "unsafe"
|
|
|
|
// Implemented in the runtime package (runtime/sys_openbsd3.go)
|
|
func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
|
func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
|
|
func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno)
|
|
func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
|
|
func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
|
|
|
|
//go:linkname syscall_syscall syscall.syscall
|
|
//go:linkname syscall_syscall6 syscall.syscall6
|
|
//go:linkname syscall_syscall10 syscall.syscall10
|
|
//go:linkname syscall_rawSyscall syscall.rawSyscall
|
|
//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
|
|
|
|
func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) {
|
|
return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0)
|
|
}
|