go icon indicating copy to clipboard operation
go copied to clipboard

all: stop using indirect system calls on openbsd

Open 4a6f656c opened this issue 1 year ago • 13 comments

The indirect syscall call interface (syscall(2)) will be removed from OpenBSD, most likely before the 7.5 release. This effectively means that Go's syscall.Syscall* interfaces will no longer work on this platform and that direct system calls (using the appropriate libc system call stub) will need to be used instead.

4a6f656c avatar Nov 02 '23 10:11 4a6f656c

Change https://go.dev/cl/538736 mentions this issue: syscall: call getfsstat via libc on openbsd

gopherbot avatar Nov 02 '23 10:11 gopherbot

Change https://go.dev/cl/468095 mentions this issue: unix: use libc stubs for OpenBSD pledge+unveil

gopherbot avatar Nov 02 '23 13:11 gopherbot

Change https://go.dev/cl/538995 mentions this issue: unix: use fcntl(2) libc stub on OpenBSD

gopherbot avatar Nov 02 '23 13:11 gopherbot

I would perhaps reword this issue, as "direct system calls" could be misinterpreted to mean applications performing syscall instructions in their text, instead of using the particular libc stubs.

When we started requiring libc for system calls in dynamically linked executables, that was also referred to switching away from "direct system calls": #36435.

jrick avatar Nov 02 '23 13:11 jrick

Change https://go.dev/cl/538976 mentions this issue: syscall: call getfsstat via libc on openbsd

gopherbot avatar Nov 03 '23 08:11 gopherbot

I would perhaps reword this issue, as "direct system calls" could be misinterpreted to mean applications performing syscall instructions in their text, instead of using the particular libc stubs.

When we started requiring libc for system calls in dynamically linked executables, that was also referred to switching away from "direct system calls": #36435.

Naming and descriptions are hard - in this case, we are moving from "indirect system calls" (i.e. syscall(2)) to "direct system calls" albeit ones via the libc stubs. In this case we're already using the libc system call stubs, it is just that we're using syscall(2) which provides indirect system calls, rather than using the libc system call stub for a specific system call.

I've retitled #36435 to explicitly state "non-libc system calls", which is hopefully clearer.

4a6f656c avatar Nov 06 '23 13:11 4a6f656c

Change https://go.dev/cl/540020 mentions this issue: os/signal,syscall: avoid calling ioctl via syscall.Syscall on BSDs

gopherbot avatar Nov 06 '23 14:11 gopherbot

Change https://go.dev/cl/540019 mentions this issue: syscall: provide and use ioctlPtr for all BSD platforms

gopherbot avatar Nov 06 '23 14:11 gopherbot

Change https://go.dev/cl/540018 mentions this issue: syscall: provide and use fcntlPtr for all BSD platforms

gopherbot avatar Nov 06 '23 14:11 gopherbot

Change https://go.dev/cl/572155 mentions this issue: syscall: export Tc{get,set}pgrp for testing

gopherbot avatar Mar 16 '24 14:03 gopherbot

Change https://go.dev/cl/582255 mentions this issue: cmd/dist,internal/platform: temporarily disable race detector on openbsd/amd64

gopherbot avatar Apr 28 '24 15:04 gopherbot

Change https://go.dev/cl/582257 mentions this issue: syscall: remove references to SYS_syscall on openbsd

gopherbot avatar Apr 28 '24 15:04 gopherbot

Change https://go.dev/cl/582256 mentions this issue: syscall: reroute SYS_IOCTL and SYS_SYSCTL on openbsd

gopherbot avatar Apr 28 '24 15:04 gopherbot