pkg/fileutil/sync_darwin.go
func Fsync(f *os.File) error {
	_, _, errno := syscall.Syscall(syscall.SYS_FCNTL, f.Fd(), uintptr(syscall.F_FULLFSYNC), uintptr(0))
	if errno == 0 {
		return nil
	}
	return errno
}
func Fsync(f *os.File) error {
	_, _, errno := syscall.Syscall(syscall.SYS_FCNTL, f.Fd(), uintptr(syscall.F_FULLFSYNC), uintptr(0))
	if errno == 0 {
		return nil
	}
	return errno
}
func Fsync ( f * os . File ) error { _ , _ , errno := syscall . Syscall ( syscall . SYS_FCNTL , f . Fd ( ) , uintptr ( syscall . F_FULLFSYNC ) , uintptr ( 0 ) ) if errno == 0 { return nil } return errno }
// Fsync on HFS/OSX flushes the data on to the physical drive but the drive
// may not write it to the persistent media for quite sometime and it may be
// written in out-of-order sequence. Using F_FULLFSYNC ensures that the
// physical drive's buffer will also get flushed to the media.
Fsync on HFS / OSX flushes the data on to the physical drive but the drive may not write it to the persistent media for quite sometime and it may be written in out - of - order sequence . Using F_FULLFSYNC ensures that the physical drive s buffer will also get flushed to the media .