mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
22 lines
387 B
Go
22 lines
387 B
Go
//go:build !sqlite3_nosys
|
|
|
|
package vfs
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func osSync(file *os.File, _ /*fullsync*/, _ /*dataonly*/ bool) error {
|
|
// SQLite trusts Linux's fdatasync for all fsync's.
|
|
return unix.Fdatasync(int(file.Fd()))
|
|
}
|
|
|
|
func osAllocate(file *os.File, size int64) error {
|
|
if size == 0 {
|
|
return nil
|
|
}
|
|
return unix.Fallocate(int(file.Fd()), 0, 0, size)
|
|
}
|