summaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_linux.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-07-04 09:04:00 +0200
committerJakob Unterwurzacher2018-07-04 09:04:00 +0200
commit53f7e1a0f02c44d19b8cda178daebe0aa466f352 (patch)
tree61d1344325da2b16c40f74db579d3ea47a47d5b8 /internal/syscallcompat/sys_linux.go
parentf6a3e2c7d1ab41028ea749017e64cb980c52096c (diff)
macos: fix O_DIRECT build failure
O_DIRECT has no direct equivalent on MacOS (check out https://github.com/libuv/libuv/issues/1600 for details). Just define it to zero there.
Diffstat (limited to 'internal/syscallcompat/sys_linux.go')
-rw-r--r--internal/syscallcompat/sys_linux.go4
1 files changed, 4 insertions, 0 deletions
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