summaryrefslogtreecommitdiff
path: root/internal/syscallcompat
diff options
context:
space:
mode:
Diffstat (limited to 'internal/syscallcompat')
-rw-r--r--internal/syscallcompat/sys_darwin.go4
-rw-r--r--internal/syscallcompat/sys_linux.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_darwin.go b/internal/syscallcompat/sys_darwin.go
index 7f2c541..74681db 100644
--- a/internal/syscallcompat/sys_darwin.go
+++ b/internal/syscallcompat/sys_darwin.go
@@ -9,6 +9,10 @@ import (
"github.com/hanwen/go-fuse/fuse"
)
+// O_DIRECT means oncached I/O on Linux. No direct equivalent on MacOS and defined
+// to zero there.
+const O_DIRECT = 0
+
// Sorry, fallocate is not available on OSX at all and
// fcntl F_PREALLOCATE is not accessible from Go.
// See https://github.com/rfjakob/gocryptfs/issues/18 if you want to help.
diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go
index b5b949e..b6f18d2 100644
--- a/internal/syscallcompat/sys_linux.go
+++ b/internal/syscallcompat/sys_linux.go
@@ -14,6 +14,10 @@ import (
const _FALLOC_FL_KEEP_SIZE = 0x01
+// O_DIRECT means oncached I/O on Linux. No direct equivalent on MacOS and defined
+// to zero there.
+const O_DIRECT = syscall.O_DIRECT
+
var preallocWarn sync.Once
// EnospcPrealloc preallocates ciphertext space without changing the file