Commit 5267db39 authored by Russ Cox's avatar Russ Cox

add os.Pipe

R=r
OCL=15989
CL=16001
parent 185a3097
......@@ -82,3 +82,12 @@ func (fd *FD) WriteString(s string) (ret int, err *Error) {
r, e := syscall.write(fd.fd, &b[0], int64(len(s)));
return int(r), ErrnoToError(e)
}
export func Pipe() (fd1 *FD, fd2 *FD, err *Error) {
var p [2]int64
r, e := syscall.pipe(&p);
if e != 0 {
return nil, nil, ErrnoToError(e)
}
return NewFD(p[0]), NewFD(p[1]), nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment