summaryrefslogtreecommitdiff
path: root/src/syscall/exec_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/exec_unix.go')
-rw-r--r--src/syscall/exec_unix.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/syscall/exec_unix.go b/src/syscall/exec_unix.go
index 725c2bc1f9..1f49c78ef9 100644
--- a/src/syscall/exec_unix.go
+++ b/src/syscall/exec_unix.go
@@ -272,6 +272,7 @@ func runtime_AfterExec()
// avoids a build dependency for other platforms.
var execveLibc func(path uintptr, argv uintptr, envp uintptr) Errno
var execveDarwin func(path *byte, argv **byte, envp **byte) error
+var execveOpenBSD func(path *byte, argv **byte, envp **byte) error
// Exec invokes the execve(2) system call.
func Exec(argv0 string, argv []string, envv []string) (err error) {
@@ -299,6 +300,9 @@ func Exec(argv0 string, argv []string, envv []string) (err error) {
} else if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
// Similarly on Darwin.
err1 = execveDarwin(argv0p, &argvp[0], &envvp[0])
+ } else if runtime.GOOS == "openbsd" && runtime.GOARCH == "amd64" {
+ // Similarly on OpenBSD.
+ err1 = execveOpenBSD(argv0p, &argvp[0], &envvp[0])
} else {
_, _, err1 = RawSyscall(SYS_EXECVE,
uintptr(unsafe.Pointer(argv0p)),