aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_linux.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-09-09 11:16:29 +0200
committerJakob Unterwurzacher2020-09-09 11:16:29 +0200
commit8b1df08b8af38aa50084abe492d0aee395492ede (patch)
tree243d931fa3f0c65daafe6c00e8bb3132a506d60e /internal/syscallcompat/sys_linux.go
parent7c0363dee5966c2cf8751cc449d19a3b5422242a (diff)
syscallcompat: add Renameat2 for Darwin
Diffstat (limited to 'internal/syscallcompat/sys_linux.go')
-rw-r--r--internal/syscallcompat/sys_linux.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go
index 42e9da6..6273504 100644
--- a/internal/syscallcompat/sys_linux.go
+++ b/internal/syscallcompat/sys_linux.go
@@ -27,6 +27,9 @@ const (
// O_PATH is only defined on Linux
O_PATH = unix.O_PATH
+
+ // RENAME_NOREPLACE is only defined on Linux
+ RENAME_NOREPLACE = unix.RENAME_NOREPLACE
)
var preallocWarn sync.Once
@@ -271,3 +274,8 @@ func UtimesNanoAtNofollow(dirfd int, path string, a *time.Time, m *time.Time) (e
func Getdents(fd int) ([]fuse.DirEntry, error) {
return getdents(fd)
}
+
+// Renameat2 does not exist on Darwin, so we have to wrap it here.
+func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) {
+ return unix.Renameat2(olddirfd, oldpath, newdirfd, newpath, flags)
+}