diff options
Diffstat (limited to 'internal/syscallcompat/sys_darwin.go')
-rw-r--r-- | internal/syscallcompat/sys_darwin.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_darwin.go b/internal/syscallcompat/sys_darwin.go index e635034..e77cd98 100644 --- a/internal/syscallcompat/sys_darwin.go +++ b/internal/syscallcompat/sys_darwin.go @@ -1,6 +1,7 @@ package syscallcompat import ( + "log" "os" "path/filepath" "sync" @@ -122,3 +123,11 @@ func dirfdAbs(dirfd int, path string) (string, error) { } return filepath.Join(wd, path), nil } + +// Dup3 is not available on Darwin, so we use Dup2 instead. +func Dup3(oldfd int, newfd int, flags int) (err error) { + if flags != 0 { + log.Panic("darwin does not support dup3 flags") + } + return syscall.Dup2(oldfd, newfd) +} |