Skip to content

Commit 5a39038

Browse files
committed
unix: convert openbsd/arm to direct libc calls
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 <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Joel Sing <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent fbc7d0a commit 5a39038

File tree

5 files changed

+1464
-139
lines changed

5 files changed

+1464
-139
lines changed

unix/mkall.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ openbsd_amd64)
156156
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
157157
;;
158158
openbsd_arm)
159+
mkasm="go run mkasm.go"
159160
mkerrors="$mkerrors"
160-
mksyscall="go run mksyscall.go -l32 -openbsd -arm"
161+
mksyscall="go run mksyscall.go -l32 -openbsd -arm -libc"
161162
mksysctl="go run mksysctl_openbsd.go"
162-
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
163163
# Let the type of C char be signed for making the bare syscall
164164
# API consistent across platforms.
165165
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"

unix/syscall_openbsd_libc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build (openbsd && 386) || (openbsd && amd64) || (openbsd && arm64)
6-
// +build openbsd,386 openbsd,amd64 openbsd,arm64
5+
//go:build (openbsd && 386) || (openbsd && amd64) || (openbsd && arm) || (openbsd && arm64)
6+
// +build openbsd,386 openbsd,amd64 openbsd,arm openbsd,arm64
77

88
package unix
99

0 commit comments

Comments
 (0)