aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_freebsd.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2017-03-21 10:23:08 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2017-03-21 20:01:23 +0000
commit0ebaca6ba27534add5930a95acffa9acff182e2b (patch)
treef77906c731c0947f4c483cd8db2698980d6ccbf6 /src/syscall/exec_freebsd.go
parent051cbf3f3720086ec6d3fd159a234bae3ffd12ef (diff)
downloadgo-0ebaca6ba27534add5930a95acffa9acff182e2b.tar.xz
syscall, os: use pipe2 syscall on FreeBSD instead of pipe
The pipe2 syscall exists in all officially supported FreeBSD versions: 10, 11 and future 12. The pipe syscall no longer exists in 11 and 12. To build and run Go on these versions, kernel needs COMPAT_FREEBSD10 option. Based on Gleb Smirnoff's https://golang.org/cl/38422 Fixes #18854 Change-Id: I8e201ee1b15dca10427c3093b966025d160aaf61 Reviewed-on: https://go-review.googlesource.com/38426 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/syscall/exec_freebsd.go')
-rw-r--r--src/syscall/exec_freebsd.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/syscall/exec_freebsd.go b/src/syscall/exec_freebsd.go
new file mode 100644
index 0000000000..1654b4ba2a
--- /dev/null
+++ b/src/syscall/exec_freebsd.go
@@ -0,0 +1,9 @@
+// Copyright 2017 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.
+
+package syscall
+
+func forkExecPipe(p []int) error {
+ return Pipe2(p, O_CLOEXEC)
+}