From e48f2377ec46f247d4db04cf8031702d0684c086 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 5 Jun 2021 15:06:30 +0200 Subject: syscallcompat: drop obsolete wrappers These are now available cross-platform in the unix package. --- internal/syscallcompat/eintr.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'internal/syscallcompat/eintr.go') diff --git a/internal/syscallcompat/eintr.go b/internal/syscallcompat/eintr.go index f0a82f5..cdde806 100644 --- a/internal/syscallcompat/eintr.go +++ b/internal/syscallcompat/eintr.go @@ -2,6 +2,8 @@ package syscallcompat import ( "syscall" + + "golang.org/x/sys/unix" ) // retryEINTR executes operation `op` and retries if it gets EINTR. @@ -43,6 +45,24 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return fd, err } +// Renameat wraps the Renameat syscall. +// Retries on EINTR. +func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + err = retryEINTR(func() error { + return unix.Renameat(olddirfd, oldpath, newdirfd, newpath) + }) + return err +} + +// Unlinkat syscall. +// Retries on EINTR. +func Unlinkat(dirfd int, path string, flags int) (err error) { + err = retryEINTR(func() error { + return unix.Unlinkat(dirfd, path, flags) + }) + return err +} + // Flush is a helper for the FUSE command FLUSH. // Retries on EINTR. func Flush(fd int) error { -- cgit v1.2.3