mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-23 22:40:39 +02:00
0x4000 is O_DIRECT only on x86 and amd64; on arm64 it is O_DIRECTORY. The test module already depends on golang.org/x/sys.
24 lines
322 B
Go
24 lines
322 B
Go
//go:build linux
|
|
|
|
package fuse
|
|
|
|
import (
|
|
"syscall"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// Direct I/O support for Linux
|
|
|
|
const (
|
|
O_DIRECT = unix.O_DIRECT
|
|
)
|
|
|
|
func openDirectIO(path string, flags int, mode uint32) (int, error) {
|
|
return syscall.Open(path, flags|O_DIRECT, mode)
|
|
}
|
|
|
|
func isDirectIOSupported() bool {
|
|
return true
|
|
}
|