Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 25a179efc4ecca45aa90793992b6c1c2743fd07f)
+++ uspace/srv/vfs/vfs_ops.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
@@ -52,5 +52,5 @@
 
 /* Forward declarations of static functions. */
-static int vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
+static errno_t vfs_truncate_internal(fs_handle_t, service_id_t, fs_index_t,
     aoff64_t);
 
@@ -86,7 +86,7 @@
 }
 
-int vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)
-{
-	int rc;
+errno_t vfs_op_clone(int oldfd, int newfd, bool desc, int *out_fd)
+{
+	errno_t rc;
 
 	/* If the file descriptors are the same, do nothing. */
@@ -121,10 +121,10 @@
 }
 
-int vfs_op_put(int fd)
+errno_t vfs_op_put(int fd)
 {
 	return vfs_fd_free(fd);
 }
 
-static int vfs_connect_internal(service_id_t service_id, unsigned flags,
+static errno_t vfs_connect_internal(service_id_t service_id, unsigned flags,
     unsigned instance, const char *options, const char *fsname,
     vfs_node_t **root)
@@ -152,5 +152,5 @@
 	    &answer);
 	/* Send the mount options */
-	int rc = async_data_write_start(exch, options, str_size(options));
+	errno_t rc = async_data_write_start(exch, options, str_size(options));
 	if (rc != EOK) {
 		async_forget(msg);
@@ -188,10 +188,10 @@
 }
 
-int vfs_op_fsprobe(const char *fs_name, service_id_t sid,
+errno_t vfs_op_fsprobe(const char *fs_name, service_id_t sid,
     vfs_fs_probe_info_t *info)
 {
 	fs_handle_t fs_handle = 0;
-	int rc;
-	int retval;
+	errno_t rc;
+	errno_t retval;
 	
 	fibril_mutex_lock(&fs_list_lock);
@@ -222,8 +222,8 @@
 }
 
-int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,
+errno_t vfs_op_mount(int mpfd, unsigned service_id, unsigned flags,
     unsigned instance, const char *opts, const char *fs_name, int *out_fd)
 {
-	int rc;
+	errno_t rc;
 	vfs_file_t *mp = NULL;
 	vfs_file_t *file = NULL;
@@ -302,5 +302,5 @@
 }
 
-int vfs_op_open(int fd, int mode)
+errno_t vfs_op_open(int fd, int mode)
 {
 	if (mode == 0)
@@ -336,5 +336,5 @@
 	}
 	
-	int rc = vfs_open_node_remote(file->node);
+	errno_t rc = vfs_open_node_remote(file->node);
 	if (rc != EOK) {
 		file->open_read = file->open_write = false;
@@ -347,12 +347,12 @@
 }
 
-typedef int (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
+typedef errno_t (* rdwr_ipc_cb_t)(async_exch_t *, vfs_file_t *, aoff64_t,
     ipc_call_t *, bool, void *);
 
-static int rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
+static errno_t rdwr_ipc_client(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
     ipc_call_t *answer, bool read, void *data)
 {
 	size_t *bytes = (size_t *) data;
-	int rc;
+	errno_t rc;
 
 	/*
@@ -378,5 +378,5 @@
 }
 
-static int rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
+static errno_t rdwr_ipc_internal(async_exch_t *exch, vfs_file_t *file, aoff64_t pos,
     ipc_call_t *answer, bool read, void *data)
 {
@@ -392,5 +392,5 @@
 		return EINVAL;
 
-	int retval = async_data_read_start(exch, chunk->buffer, chunk->size);
+	errno_t retval = async_data_read_start(exch, chunk->buffer, chunk->size);
 	if (retval != EOK) {
 		async_forget(msg);
@@ -398,13 +398,13 @@
 	}
 	
-	int rc;
+	errno_t rc;
 	async_wait_for(msg, &rc);
 	
 	chunk->size = IPC_GET_ARG1(*answer); 
 
-	return (int) rc;
-}
-
-static int vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,
+	return (errno_t) rc;
+}
+
+static errno_t vfs_rdwr(int fd, aoff64_t pos, bool read, rdwr_ipc_cb_t ipc_cb,
     void *ipc_cb_data)
 {
@@ -475,5 +475,5 @@
 	 */
 	ipc_call_t answer;
-	int rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
+	errno_t rc = ipc_cb(fs_exch, file, pos, &answer, read, ipc_cb_data);
 	
 	vfs_exchange_release(fs_exch);
@@ -499,15 +499,15 @@
 }
 
-int vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)
+errno_t vfs_rdwr_internal(int fd, aoff64_t pos, bool read, rdwr_io_chunk_t *chunk)
 {
 	return vfs_rdwr(fd, pos, read, rdwr_ipc_internal, chunk);
 }
 
-int vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)
+errno_t vfs_op_read(int fd, aoff64_t pos, size_t *out_bytes)
 {
 	return vfs_rdwr(fd, pos, true, rdwr_ipc_client, out_bytes);
 }
 
-int vfs_op_rename(int basefd, char *old, char *new)
+errno_t vfs_op_rename(int basefd, char *old, char *new)
 {
 	vfs_file_t *base_file = vfs_file_get(basefd);
@@ -524,5 +524,5 @@
 	bool orig_unlinked = false;
 	
-	int rc;
+	errno_t rc;
 	
 	size_t shared = shared_path(old, new);
@@ -610,5 +610,5 @@
 }
 
-int vfs_op_resize(int fd, int64_t size)
+errno_t vfs_op_resize(int fd, int64_t size)
 {
 	vfs_file_t *file = vfs_file_get(fd);
@@ -618,5 +618,5 @@
 	fibril_rwlock_write_lock(&file->node->contents_rwlock);
 	
-	int rc = vfs_truncate_internal(file->node->fs_handle,
+	errno_t rc = vfs_truncate_internal(file->node->fs_handle,
 	    file->node->service_id, file->node->index, size);
 	if (rc == EOK)
@@ -628,5 +628,5 @@
 }
 
-int vfs_op_stat(int fd)
+errno_t vfs_op_stat(int fd)
 {
 	vfs_file_t *file = vfs_file_get(fd);
@@ -637,5 +637,5 @@
 
 	async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
-	int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,
+	errno_t rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,
 	    node->service_id, node->index, true, 0, NULL);
 	vfs_exchange_release(exch);
@@ -645,5 +645,5 @@
 }
 
-int vfs_op_statfs(int fd)
+errno_t vfs_op_statfs(int fd)
 {
 	vfs_file_t *file = vfs_file_get(fd);
@@ -654,5 +654,5 @@
 
 	async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
-	int rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,
+	errno_t rc = async_data_read_forward_fast(exch, VFS_OUT_STATFS,
 	    node->service_id, node->index, false, 0, NULL);
 	vfs_exchange_release(exch);
@@ -662,5 +662,5 @@
 }
 
-int vfs_op_sync(int fd)
+errno_t vfs_op_sync(int fd)
 {
 	vfs_file_t *file = vfs_file_get(fd);
@@ -677,5 +677,5 @@
 	vfs_exchange_release(fs_exch);
 	
-	int rc;
+	errno_t rc;
 	async_wait_for(msg, &rc);
 	
@@ -685,19 +685,19 @@
 }
 
-static int vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,
+static errno_t vfs_truncate_internal(fs_handle_t fs_handle, service_id_t service_id,
     fs_index_t index, aoff64_t size)
 {
 	async_exch_t *exch = vfs_exchange_grab(fs_handle);
-	int rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,
+	errno_t rc = async_req_4_0(exch, VFS_OUT_TRUNCATE,
 	    (sysarg_t) service_id, (sysarg_t) index, LOWER32(size),
 	    UPPER32(size));
 	vfs_exchange_release(exch);
 	
-	return (int) rc;
-}
-
-int vfs_op_unlink(int parentfd, int expectfd, char *path)
-{
-	int rc = EOK;
+	return (errno_t) rc;
+}
+
+errno_t vfs_op_unlink(int parentfd, int expectfd, char *path)
+{
+	errno_t rc = EOK;
 	vfs_file_t *parent = NULL;
 	vfs_file_t *expect = NULL;
@@ -778,5 +778,5 @@
 }
 
-int vfs_op_unmount(int mpfd)
+errno_t vfs_op_unmount(int mpfd)
 {
 	vfs_file_t *mp = vfs_file_get(mpfd);
@@ -806,5 +806,5 @@
 	
 	async_exch_t *exch = vfs_exchange_grab(mp->node->mount->fs_handle);
-	int rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
+	errno_t rc = async_req_1_0(exch, VFS_OUT_UNMOUNTED,
 	    mp->node->mount->service_id);
 	vfs_exchange_release(exch);
@@ -826,5 +826,5 @@
 }
 
-int vfs_op_wait_handle(bool high_fd, int *out_fd)
+errno_t vfs_op_wait_handle(bool high_fd, int *out_fd)
 {
 	return vfs_wait_handle_internal(high_fd, out_fd);
@@ -862,5 +862,5 @@
 }
 
-int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)
+errno_t vfs_op_walk(int parentfd, int flags, char *path, int *out_fd)
 {
 	if (!walk_flags_valid(flags))
@@ -874,5 +874,5 @@
 	
 	vfs_lookup_res_t lr;
-	int rc = vfs_lookup_internal(parent->node, path,
+	errno_t rc = vfs_lookup_internal(parent->node, path,
 	    walk_lookup_flags(flags), &lr);
 	if (rc != EOK) {
@@ -911,5 +911,5 @@
 }
 
-int vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)
+errno_t vfs_op_write(int fd, aoff64_t pos, size_t *out_bytes)
 {
 	return vfs_rdwr(fd, pos, false, rdwr_ipc_client, out_bytes);
