github.com/pingcap/badger@v1.5.1-0.20230103063557-828f39b09b6d/fileutil/sync.go (about)

     1  // +build !linux,!darwin
     2  
     3  package fileutil
     4  
     5  import "os"
     6  
     7  // Fsync is a wrapper around file.Sync(). Special handling is needed on darwin platform.
     8  func Fsync(f *os.File) error {
     9  	return f.Sync()
    10  }
    11  
    12  // Fdatasync is a wrapper around file.Sync(). Special handling is needed on linux platform.
    13  func Fdatasync(f *os.File) error {
    14  	return f.Sync()
    15  }