[1/7] Preprocessor cleanup
[official-gcc.git] / libgo / go / syscall / forkpipe.go
blob71890a29badcca66b15911e2c888ff7e944a0a80
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build darwin dragonfly solaris
7 package syscall
9 // Try to open a pipe with O_CLOEXEC set on both file descriptors.
10 func forkExecPipe(p []int) error {
11 err := Pipe(p)
12 if err != nil {
13 return err
15 _, err = fcntl(p[0], F_SETFD, FD_CLOEXEC)
16 if err != nil {
17 return err
19 _, err = fcntl(p[1], F_SETFD, FD_CLOEXEC)
20 return err