diff options
Diffstat (limited to 'src/os/file_windows.go')
-rw-r--r-- | src/os/file_windows.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/os/file_windows.go b/src/os/file_windows.go index 11ae1e0d1..cf9703808 100644 --- a/src/os/file_windows.go +++ b/src/os/file_windows.go @@ -5,3 +5,20 @@ package os import "syscall" type syscallFd = syscall.Handle + +func Pipe() (r *File, w *File, err error) { + var p [2]syscall.Handle + e := handleSyscallError(syscall.Pipe(p[:])) + if e != nil { + return nil, nil, err + } + r = &File{ + handle: unixFileHandle(p[0]), + name: "|0", + } + w = &File{ + handle: unixFileHandle(p[1]), + name: "|1", + } + return +} |