containerd/vendor/github.com/boltdb/bolt/bolt_openbsd.go
Stephen J Day 706ba7212f
vendor: add boltdb dependency
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-03-21 13:08:32 -07:00

27 lines
518 B
Go

package bolt
import (
"syscall"
"unsafe"
)
const (
msAsync = 1 << iota // perform asynchronous writes
msSync // perform synchronous writes
msInvalidate // invalidate cached data
)
func msync(db *DB) error {
_, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate)
if errno != 0 {
return errno
}
return nil
}
func fdatasync(db *DB) error {
if db.data != nil {
return msync(db)
}
return db.file.Sync()
}