diff options
author | Sebastian Lackner | 2019-01-14 02:32:28 +0100 |
---|---|---|
committer | rfjakob | 2019-01-14 21:27:28 +0100 |
commit | da557702d713e38a8c6c4c28275724c70988f919 (patch) | |
tree | 615a8c9487b52c18d74bed29defd03d03c933743 /internal/syscallcompat/emulate.go | |
parent | d7be76685128cb2cdca01becd856ea57cc18ef34 (diff) |
syscallcompat: Drop Openat emulation on macOS.
Diffstat (limited to 'internal/syscallcompat/emulate.go')
-rw-r--r-- | internal/syscallcompat/emulate.go | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/internal/syscallcompat/emulate.go b/internal/syscallcompat/emulate.go index c0a0d09..35e17c6 100644 --- a/internal/syscallcompat/emulate.go +++ b/internal/syscallcompat/emulate.go @@ -11,26 +11,6 @@ import ( var chdirMutex sync.Mutex -// emulateOpenat emulates the syscall for platforms that don't have it -// in the kernel (darwin). -func emulateOpenat(dirfd int, path string, flags int, mode uint32) (int, error) { - if !filepath.IsAbs(path) { - chdirMutex.Lock() - defer chdirMutex.Unlock() - cwd, err := syscall.Open(".", syscall.O_RDONLY, 0) - if err != nil { - return -1, err - } - defer syscall.Close(cwd) - err = syscall.Fchdir(dirfd) - if err != nil { - return -1, err - } - defer syscall.Fchdir(cwd) - } - return syscall.Open(path, flags, mode) -} - // emulateRenameat emulates the syscall for platforms that don't have it // in the kernel (darwin). func emulateRenameat(olddirfd int, oldpath string, newdirfd int, newpath string) error { |