github.com/comwrg/go/src@v0.0.0-20220319063731-c238d0440370/runtime/nbpipe_pipe.go (about) 1 // Copyright 2019 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. 4 5 //go:build aix || darwin 6 // +build aix darwin 7 8 package runtime 9 10 func nonblockingPipe() (r, w int32, errno int32) { 11 r, w, errno = pipe() 12 if errno != 0 { 13 return -1, -1, errno 14 } 15 closeonexec(r) 16 setNonblock(r) 17 closeonexec(w) 18 setNonblock(w) 19 return r, w, errno 20 }