Index: uspace/app/kio/kio.c
===================================================================
--- uspace/app/kio/kio.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
+++ uspace/app/kio/kio.c	(revision a56cef94f0134cc76a541b53862ec1f1d710d49c)
@@ -48,4 +48,5 @@
 #include <adt/prodcons.h>
 #include <tinput.h>
+#include <vfs/vfs.h>
 
 #define NAME       "kio"
@@ -128,5 +129,5 @@
 			
 			fflush(log);
-			fsync(fileno(log));
+			vfs_sync(fileno(log));
 		}
 		
Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
+++ uspace/lib/c/generic/io/io.c	(revision a56cef94f0134cc76a541b53862ec1f1d710d49c)
@@ -836,4 +836,6 @@
 	
 	if ((stream->fd >= 0) && (stream->need_sync)) {
+		int rc;
+
 		/**
 		 * Better than syncing always, but probably still not the
@@ -841,6 +843,7 @@
 		 */
 		stream->need_sync = false;
-		if (fsync(stream->fd) != 0) {
-			/* errno was set by fsync() */
+		rc = vfs_sync(stream->fd);
+		if (rc != EOK) {
+			errno = rc;
 			return EOF;
 		}
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision a56cef94f0134cc76a541b53862ec1f1d710d49c)
@@ -597,18 +597,13 @@
  *
  * @param fildes File descriptor
- * @return 0 on success. On error returns -1 and sets errno.
- */
-int fsync(int fildes)
-{
-	async_exch_t *exch = vfs_exchange_begin();
-	sysarg_t rc = async_req_1_0(exch, VFS_IN_SYNC, fildes);
-	vfs_exchange_end(exch);
-	
-	if (rc != EOK) {
-		errno = rc;
-		return -1;
-	}
-	
-	return 0;
+ * @return EOK on success or a negative error code otherwise.
+ */
+int vfs_sync(int file)
+{
+	async_exch_t *exch = vfs_exchange_begin();
+	sysarg_t rc = async_req_1_0(exch, VFS_IN_SYNC, file);
+	vfs_exchange_end(exch);
+	
+	return rc;
 }
 
@@ -620,5 +615,5 @@
  * @param length Length
  *
- * @return 0 on success or a negative erroc code otherwise.
+ * @return EOK on success or a negative erroc code otherwise.
  */
 int vfs_resize(int file, aoff64_t length)
Index: uspace/lib/c/include/unistd.h
===================================================================
--- uspace/lib/c/include/unistd.h	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
+++ uspace/lib/c/include/unistd.h	(revision a56cef94f0134cc76a541b53862ec1f1d710d49c)
@@ -62,5 +62,4 @@
 
 extern int close(int);
-extern int fsync(int);
 
 extern char *getcwd(char *, size_t);
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
+++ uspace/lib/c/include/vfs/vfs.h	(revision a56cef94f0134cc76a541b53862ec1f1d710d49c)
@@ -95,4 +95,5 @@
 extern int vfs_statfs(int, struct statfs *);
 extern int vfs_statfs_path(const char *, struct statfs *);
+extern int vfs_sync(int);
 extern int vfs_unlink(int, const char *, int);
 extern int vfs_unlink_path(const char *);
Index: uspace/lib/posix/source/unistd.c
===================================================================
--- uspace/lib/posix/source/unistd.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
+++ uspace/lib/posix/source/unistd.c	(revision a56cef94f0134cc76a541b53862ec1f1d710d49c)
@@ -247,5 +247,8 @@
 int posix_fsync(int fildes)
 {
-	return negerrno(fsync, fildes);
+	if (rcerrno(vfs_sync, fildes) != EOK)
+		return -1;
+	else
+		return 0;
 }
 
