// Copyright 2013 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. | |
// +build fuchsia | |
package os | |
import ( | |
"syscall" | |
"syscall/zx/fdio" | |
) | |
func Pipe() (r *File, w *File, err error) { | |
p0, p1, err := fdio.NewPipes() | |
if err != nil { | |
return nil, nil, err | |
} | |
r = NewFile(uintptr(syscall.OpenFDIO(p0)), "|0") | |
w = NewFile(uintptr(syscall.OpenFDIO(p1)), "|1") | |
// TODO CloseOnExec equivalent | |
return r, w, nil | |
} |