github.com/LanceLRQ/deer-common@v0.0.9-0.20210319081233-e8222ac018a8/sandbox/forkexec/syscall_darwin.go (about)

     1  // +build darwin
     2  
     3  package forkexec
     4  
     5  import "syscall"
     6  
     7  // 获取管道数据
     8  func GetPipe() ([]uintptr, error) {
     9  	var pipe = []int{0, 0}
    10  	err := syscall.Pipe(pipe)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  	return []uintptr{uintptr(pipe[0]), uintptr(pipe[1])}, nil
    15  }