bbolt/bolt_openbsd.go
Josh Rickmar 46437cea06 Avoid syscall.Syscall use on OpenBSD
Syscall numbers are not stable on OpenBSD, and hardcoding the msync
syscall number will break bbolt on future versions of OpenBSD.  Use
the libc wrapper provided by golang.org/x/sys/unix instead.

Signed-off-by: Josh Rickmar <jrick@zettaport.com>
2023-02-12 05:47:49 +08:00

17 lines
241 B
Go

package bbolt
import (
"golang.org/x/sys/unix"
)
func msync(db *DB) error {
return unix.Msync(db.data[:db.datasz], unix.MS_INVALIDATE)
}
func fdatasync(db *DB) error {
if db.data != nil {
return msync(db)
}
return db.file.Sync()
}