Skip to content

Commit 5f8f020

Browse files
4a6f656cgopherbot
authored andcommitted
unix: convert openbsd/amd64 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/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: Iadd5734fd4a2421d758883293bd8a6759fc52ca7 Reviewed-on: https://go-review.googlesource.com/c/sys/+/421797 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Joel Sing <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Than McIntosh <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent 74508da commit 5f8f020

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
@@ -149,10 +149,10 @@ openbsd_386)
149149
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
150150
;;
151151
openbsd_amd64)
152+
mkasm="go run mkasm.go"
152153
mkerrors="$mkerrors -m64"
153-
mksyscall="go run mksyscall.go -openbsd"
154+
mksyscall="go run mksyscall.go -openbsd -libc"
154155
mksysctl="go run mksysctl_openbsd.go"
155-
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
156156
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
157157
;;
158158
openbsd_arm)

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 && arm64
6-
// +build openbsd,arm64
5+
//go:build (openbsd && amd64) || (openbsd && arm64)
6+
// +build openbsd,amd64 openbsd,arm64
77

88
package unix
99

0 commit comments

Comments
 (0)