From da557702d713e38a8c6c4c28275724c70988f919 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Mon, 14 Jan 2019 02:32:28 +0100 Subject: syscallcompat: Drop Openat emulation on macOS. --- internal/syscallcompat/sys_linux.go | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'internal/syscallcompat/sys_linux.go') diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go index 6f2a70d..d5dc021 100644 --- a/internal/syscallcompat/sys_linux.go +++ b/internal/syscallcompat/sys_linux.go @@ -58,24 +58,6 @@ func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { return syscall.Fallocate(fd, mode, off, len) } -// Openat wraps the Openat syscall. -func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { - if flags&syscall.O_CREAT != 0 { - // O_CREAT should be used with O_EXCL. O_NOFOLLOW has no effect with O_EXCL. - if flags&syscall.O_EXCL == 0 { - tlog.Warn.Printf("Openat: O_CREAT without O_EXCL: flags = %#x", flags) - flags |= syscall.O_EXCL - } - } else { - // If O_CREAT is not used, we should use O_NOFOLLOW - if flags&syscall.O_NOFOLLOW == 0 { - tlog.Warn.Printf("Openat: O_NOFOLLOW missing: flags = %#x", flags) - flags |= syscall.O_NOFOLLOW - } - } - return syscall.Openat(dirfd, path, flags, mode) -} - // OpenatUser runs the Openat syscall in the context of a different user. func OpenatUser(dirfd int, path string, flags int, mode uint32, context *fuse.Context) (fd int, err error) { if context != nil { -- cgit v1.2.3