os: add os.(*File).Sync

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
This commit is contained in:
Achille Roussel
2023-05-01 11:07:29 -07:00
committed by Ron Evans
parent 4fa6a132e2
commit ccfe92a58c
8 changed files with 27 additions and 15 deletions
+5
View File
@@ -130,6 +130,11 @@ func (f unixFileHandle) Seek(offset int64, whence int) (int64, error) {
return newoffset, handleSyscallError(err)
}
func (f unixFileHandle) Sync() error {
err := syscall.Fsync(syscallFd(f))
return handleSyscallError(err)
}
type unixDirent struct {
parent string
name string