Index: uspace/app/bdsh/cmds/modules/mv/mv.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mv/mv.c	(revision 151f1cc5a424a21091c1839670a7631416253a1f)
+++ uspace/app/bdsh/cmds/modules/mv/mv.c	(revision 163fc0963aff02c35c25572b75d24681834e9f1c)
@@ -30,4 +30,5 @@
 #include <stdlib.h>
 #include <errno.h>
+#include <vfs/vfs.h>
 #include "config.h"
 #include "util.h"
@@ -59,8 +60,8 @@
 	}
 
-	rc = rename(argv[1], argv[2]);
-	if (rc != 0) {
+	rc = vfs_rename_path(argv[1], argv[2]);
+	if (rc != EOK) {
 		printf("Unable to rename %s to %s (error=%d)\n",
-		    argv[1], argv[2], errno);
+		    argv[1], argv[2], rc);
 		return CMD_FAILURE;
 	}
Index: uspace/app/tester/vfs/vfs1.c
===================================================================
--- uspace/app/tester/vfs/vfs1.c	(revision 151f1cc5a424a21091c1839670a7631416253a1f)
+++ uspace/app/tester/vfs/vfs1.c	(revision 163fc0963aff02c35c25572b75d24681834e9f1c)
@@ -114,6 +114,6 @@
 		return rv;
 	
-	if (rename(TEST_FILE, TEST_FILE2) != 0)
-		return "rename() failed";
+	if (vfs_rename_path(TEST_FILE, TEST_FILE2) != EOK)
+		return "vfs_rename_path() failed";
 	TPRINTF("Renamed %s to %s\n", TEST_FILE, TEST_FILE2);
 	
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 151f1cc5a424a21091c1839670a7631416253a1f)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 163fc0963aff02c35c25572b75d24681834e9f1c)
@@ -833,7 +833,7 @@
  * @param new New name
  *
- * @return 0 on success. On error returns -1 and sets errno.
- */
-int rename(const char *old, const char *new)
+ * @return EOK on success or a negative error code otherwise.
+ */
+int vfs_rename_path(const char *old, const char *new)
 {
 	sysarg_t rc;
@@ -843,8 +843,6 @@
 	size_t olda_size;
 	char *olda = vfs_absolutize(old, &olda_size);
-	if (olda == NULL) {
-		errno = ENOMEM;
-		return -1;
-	}
+	if (olda == NULL)
+		return ENOMEM;
 
 	size_t newa_size;
@@ -852,6 +850,5 @@
 	if (newa == NULL) {
 		free(olda);
-		errno = ENOMEM;
-		return -1;
+		return ENOMEM;
 	}
 	
@@ -861,6 +858,5 @@
 		free(olda);
 		free(newa);
-		errno = ENOENT;
-		return -1;
+		return ENOENT;
 	}
 	
@@ -875,9 +871,5 @@
 		if (rc_orig != EOK)
 			rc = rc_orig;
-		if (rc != EOK) {
-			errno = rc;
-			return -1;
-		}
-		return 0;
+		return rc;
 	}
 	rc = async_data_write_start(exch, newa, newa_size);
@@ -890,9 +882,5 @@
 		if (rc_orig != EOK)
 			rc = rc_orig;
-		if (rc != EOK) {
-			errno = rc;
-			return -1;
-		}
-		return 0;
+		return rc;
 	}
 	vfs_exchange_end(exch);
@@ -902,10 +890,5 @@
 	async_wait_for(req, &rc);
 
-	if (rc != EOK) {
-		errno = rc;
-		return -1;
-	}
-
-	return 0;
+	return rc;
 }
 
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision 151f1cc5a424a21091c1839670a7631416253a1f)
+++ uspace/lib/c/include/stdio.h	(revision 163fc0963aff02c35c25572b75d24681834e9f1c)
@@ -141,7 +141,4 @@
 extern void setbuf(FILE *, void *);
 
-/* Misc file functions */
-extern int rename(const char *, const char *);
-
 #endif
 
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision 151f1cc5a424a21091c1839670a7631416253a1f)
+++ uspace/lib/c/include/vfs/vfs.h	(revision 163fc0963aff02c35c25572b75d24681834e9f1c)
@@ -96,4 +96,5 @@
 extern int vfs_open(int, int);
 extern int vfs_put(int);
+extern int vfs_rename_path(const char *, const char *);
 extern int vfs_resize(int, aoff64_t);
 extern int vfs_root(void);
Index: uspace/lib/posix/source/stdio.c
===================================================================
--- uspace/lib/posix/source/stdio.c	(revision 151f1cc5a424a21091c1839670a7631416253a1f)
+++ uspace/lib/posix/source/stdio.c	(revision 163fc0963aff02c35c25572b75d24681834e9f1c)
@@ -590,5 +590,9 @@
 int posix_rename(const char *old, const char *new)
 {
-	return negerrno(rename, old, new);
+	int rc = rcerrno(vfs_rename_path, old, new);
+	if (rc != EOK)
+		return -1;
+	else
+		return 0;
 }
 
