syscall: add fsync using libc

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
This commit is contained in:
Achille Roussel
2023-05-01 10:59:12 -07:00
committed by Ron Evans
parent 1a67795fd3
commit 4fa6a132e2
+12
View File
@@ -71,6 +71,13 @@ func Open(path string, flag int, mode uint32) (fd int, err error) {
return
}
func Fsync(fd int) (err error) {
if libc_fsync(int32(fd)) < 0 {
err = getErrno()
}
return
}
func Readlink(path string, p []byte) (n int, err error) {
data := cstring(path)
buf, count := splitSlice(p)
@@ -404,6 +411,11 @@ func libc_rename(from, to *byte) int32
//export symlink
func libc_symlink(from, to *byte) int32
// int fsync(int fd);
//
//export fsync
func libc_fsync(fd int32) int32
// ssize_t readlink(const char *path, void *buf, size_t count);
//
//export readlink