summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/emulate.go
diff options
context:
space:
mode:
authorSebastian Lackner2019-01-14 02:38:34 +0100
committerrfjakob2019-01-14 21:27:28 +0100
commit229a9da74bc0839e2cd481f701c877708b080ede (patch)
treea1eed605271537ce53b76038b51bc0decf9ddf0b /internal/syscallcompat/emulate.go
parent42bf6d1c68700a0d5d910c1be42088cc14125fec (diff)
syscallcompat: Drop Unlinkat emulation on macOS.
Diffstat (limited to 'internal/syscallcompat/emulate.go')
-rw-r--r--internal/syscallcompat/emulate.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/internal/syscallcompat/emulate.go b/internal/syscallcompat/emulate.go
index 7fea3a8..360c0ac 100644
--- a/internal/syscallcompat/emulate.go
+++ b/internal/syscallcompat/emulate.go
@@ -11,29 +11,6 @@ import (
var chdirMutex sync.Mutex
-// emulateUnlinkat emulates the syscall for platforms that don't have it
-// in the kernel (darwin).
-func emulateUnlinkat(dirfd int, path string, 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)
- }
- if (flags & unix.AT_REMOVEDIR) != 0 {
- return syscall.Rmdir(path)
- }
- return syscall.Unlink(path)
-}
-
// emulateMknodat emulates the syscall for platforms that don't have it
// in the kernel (darwin).
func emulateMknodat(dirfd int, path string, mode uint32, dev int) error {