Index: uspace/lib/libc/generic/vfs/vfs.c
===================================================================
--- uspace/lib/libc/generic/vfs/vfs.c	(revision d5d9c53b6896fc9cd649567b0fa1f3d8c172eeb1)
+++ uspace/lib/libc/generic/vfs/vfs.c	(revision f2ec8c8a9370e04756e68eab848a456f0374de5f)
@@ -469,4 +469,71 @@
 }
 
+int rename(const char *old, const char *new)
+{
+	int res;
+	ipcarg_t rc;
+	aid_t req;
+	
+	char *olda = absolutize(old);
+	if (!olda)
+		return ENOMEM;
+	size_t oldc_len;
+	char *oldc = canonify(olda, &oldc_len);
+	if (!oldc) {
+		free(olda);
+		return EINVAL;
+	}
+	char *newa = absolutize(new);
+	if (!newa) {
+		free(olda);
+		return ENOMEM;
+	}
+	size_t newc_len;
+	char *newc = canonify(newa, &newc_len);
+	if (!newc) {
+		free(olda);
+		free(newa);
+		return EINVAL;
+	}
+
+	futex_down(&vfs_phone_futex);
+	async_serialize_start();
+	if (vfs_phone < 0) {
+		res = vfs_connect();
+		if (res < 0) {
+			async_serialize_end();
+			futex_up(&vfs_phone_futex);
+			free(olda);
+			free(newa);
+			return res;
+		}
+	}
+	req = async_send_0(vfs_phone, VFS_RENAME, NULL);
+	rc = ipc_data_write_start(vfs_phone, oldc, oldc_len);
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		async_serialize_end();
+		futex_up(&vfs_phone_futex);
+		free(olda);
+		free(newa);
+		return (int) rc;
+	}
+	rc = ipc_data_write_start(vfs_phone, newc, newc_len);
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		async_serialize_end();
+		futex_up(&vfs_phone_futex);
+		free(olda);
+		free(newa);
+		return (int) rc;
+	}
+	async_wait_for(req, &rc);
+	async_serialize_end();
+	futex_up(&vfs_phone_futex);
+	free(olda);
+	free(newa);
+	return rc;
+}
+
 int chdir(const char *path)
 {
