Skip to content

Commit

Permalink
Fdatasync.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed Mar 21, 2024
1 parent 617982f commit b7d22e8
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions vfs/os_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ import (
"golang.org/x/sys/unix"
)

func osSync(file *os.File, _ /*fullsync*/, dataonly bool) error {
if dataonly {
_, _, err := unix.Syscall(unix.SYS_FDATASYNC, file.Fd(), 0, 0)
if err != 0 {
return err
}
return nil
}
return file.Sync()
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 {
Expand Down

0 comments on commit b7d22e8

Please sign in to comment.