diff options
author | Sebastian Lackner | 2019-01-14 03:00:49 +0100 |
---|---|---|
committer | rfjakob | 2019-01-14 21:27:28 +0100 |
commit | a9d8eb49ef91c31fddc3e4f2f76e9b98e1a52a1d (patch) | |
tree | 1ceec94d92a33d4ff8282f8baef80aafbdb21e3d /internal/syscallcompat/emulate.go | |
parent | 4134ff7570906d38d519b1aad33cd3e97685e92f (diff) |
syscallcompat: Drop Fstatat emulation on macOS.
Diffstat (limited to 'internal/syscallcompat/emulate.go')
-rw-r--r-- | internal/syscallcompat/emulate.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/internal/syscallcompat/emulate.go b/internal/syscallcompat/emulate.go index 7bed31a..91b592b 100644 --- a/internal/syscallcompat/emulate.go +++ b/internal/syscallcompat/emulate.go @@ -4,8 +4,6 @@ import ( "path/filepath" "sync" "syscall" - - "golang.org/x/sys/unix" ) var chdirMutex sync.Mutex @@ -29,23 +27,3 @@ func emulateMknodat(dirfd int, path string, mode uint32, dev int) error { } return syscall.Mknod(path, mode, dev) } - -// emulateFstatat emulates the syscall for platforms that don't have it -// in the kernel (darwin). -func emulateFstatat(dirfd int, path string, stat *unix.Stat_t, flags int) (err error) { - if !filepath.IsAbs(path) { - chdirMutex.Lock() - defer chdirMutex.Unlock() - cwd, err := syscall.Open(".", syscall.O_RDONLY, 0) - if err != nil { - return err - } - defer syscall.Close(cwd) - err = syscall.Fchdir(dirfd) - if err != nil { - return err - } - defer syscall.Fchdir(cwd) - } - return unix.Lstat(path, stat) -} |