diff options
Diffstat (limited to 'libgo/syscalls/sysfile_posix.go')
-rw-r--r-- | libgo/syscalls/sysfile_posix.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/syscalls/sysfile_posix.go b/libgo/syscalls/sysfile_posix.go index 1458bf56097..655eb7353e6 100644 --- a/libgo/syscalls/sysfile_posix.go +++ b/libgo/syscalls/sysfile_posix.go @@ -16,6 +16,7 @@ func libc_open(name *byte, mode int, perm Mode_t) int __asm__ ("open"); func libc_close(fd int) int __asm__ ("close"); func libc_read(fd int, buf *byte, count Size_t) Ssize_t __asm__ ("read"); func libc_write(fd int, buf *byte, count Size_t) Ssize_t __asm__ ("write"); +func libc_fsync(fd int) int __asm__ ("fsync") func libc_pipe(filedes *int) int __asm__("pipe"); func libc_stat(name *byte, buf *Stat_t) int __asm__ ("stat"); func libc_fstat(fd int, buf *Stat_t) int __asm__ ("fstat"); @@ -87,6 +88,13 @@ func Write(fd int, p []byte) (n int, errno int) { return; } +func Fsync(fd int) (errno int) { + if libc_fsync(fd) < 0 { + errno = GetErrno() + } + return +} + func Pread(fd int, p []byte, offset int64) (n int, errno int) { var _p0 *byte; if len(p) > 0 { _p0 = &p[0]; } |