Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/app/trace/trace.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -706,5 +706,5 @@
 	proto_add_oper(p, VFS_IN_WRITE, o);
 	o = oper_new("truncate", 5, arg_def, V_ERRNO, 0, resp_def);
-	proto_add_oper(p, VFS_IN_TRUNCATE, o);
+	proto_add_oper(p, VFS_IN_RESIZE, o);
 	o = oper_new("fstat", 1, arg_def, V_ERRNO, 0, resp_def);
 	proto_add_oper(p, VFS_IN_STAT, o);
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -408,5 +408,5 @@
 		assert(!(oflag & O_APPEND));
 		
-		(void) ftruncate(fd, 0);
+		(void) vfs_resize(fd, 0);
 	}
 
@@ -620,21 +620,16 @@
  * @param length Length
  *
- * @return 0 on success, -1 on error and sets errno.
- */
-int ftruncate(int fildes, aoff64_t length)
+ * @return 0 on success or a negative erroc code otherwise.
+ */
+int vfs_resize(int file, aoff64_t length)
 {
 	sysarg_t rc;
 	
 	async_exch_t *exch = vfs_exchange_begin();
-	rc = async_req_3_0(exch, VFS_IN_TRUNCATE, fildes,
-	    LOWER32(length), UPPER32(length));
-	vfs_exchange_end(exch);
-	
-	if (rc != EOK) {
-		errno = rc;
-		return -1;
-	}
-	
-	return 0;
+	rc = async_req_3_0(exch, VFS_IN_RESIZE, file, LOWER32(length),
+	    UPPER32(length));
+	vfs_exchange_end(exch);
+	
+	return rc;
 }
 
Index: uspace/lib/c/include/ipc/vfs.h
===================================================================
--- uspace/lib/c/include/ipc/vfs.h	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/lib/c/include/ipc/vfs.h	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -65,5 +65,5 @@
 	VFS_IN_READ = IPC_FIRST_USER_METHOD,
 	VFS_IN_WRITE,
-	VFS_IN_TRUNCATE,
+	VFS_IN_RESIZE,
 	VFS_IN_STAT,
 	VFS_IN_CLOSE,
Index: uspace/lib/c/include/unistd.h
===================================================================
--- uspace/lib/c/include/unistd.h	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/lib/c/include/unistd.h	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -61,6 +61,4 @@
 extern ssize_t read(int, aoff64_t *, void *, size_t);
 
-extern int ftruncate(int, aoff64_t);
-
 extern int close(int);
 extern int fsync(int);
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/lib/c/include/vfs/vfs.h	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -90,4 +90,5 @@
 extern int vfs_root(void);
 extern void vfs_root_set(int);
+extern int vfs_resize(int, aoff64_t);
 extern int vfs_stat(int, struct stat *);
 extern int vfs_stat_path(const char *, struct stat *);
Index: uspace/lib/posix/source/unistd.c
===================================================================
--- uspace/lib/posix/source/unistd.c	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/lib/posix/source/unistd.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -259,5 +259,8 @@
 int posix_ftruncate(int fildes, posix_off_t length)
 {
-	return negerrno(ftruncate, fildes, (aoff64_t) length);
+	if (rcerrno(vfs_resize, fildes, (aoff64_t) length) != EOK)
+		return -1;
+	else
+		return 0;
 }
 
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/srv/vfs/vfs.h	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -211,8 +211,8 @@
 extern int vfs_op_read(int fd, aoff64_t, size_t *out_bytes);
 extern int vfs_op_rename(int basefd, char *old, char *new);
+extern int vfs_op_resize(int fd, int64_t size);
 extern int vfs_op_stat(int fd);
 extern int vfs_op_statfs(int fd);
 extern int vfs_op_sync(int fd);
-extern int vfs_op_truncate(int fd, int64_t size);
 extern int vfs_op_unlink(int parentfd, int expectfd, char *path);
 extern int vfs_op_unmount(int mpfd);
Index: uspace/srv/vfs/vfs_ipc.c
===================================================================
--- uspace/srv/vfs/vfs_ipc.c	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/srv/vfs/vfs_ipc.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -160,4 +160,12 @@
 }
 
+static void vfs_in_resize(ipc_callid_t rid, ipc_call_t *request)
+{
+	int fd = IPC_GET_ARG1(*request);
+	int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*request), IPC_GET_ARG3(*request));
+	int rc = vfs_op_resize(fd, size);
+	async_answer_0(rid, rc);
+}
+
 static void vfs_in_stat(ipc_callid_t rid, ipc_call_t *request)
 {
@@ -179,12 +187,4 @@
 	int fd = IPC_GET_ARG1(*request);
 	int rc = vfs_op_sync(fd);
-	async_answer_0(rid, rc);
-}
-
-static void vfs_in_truncate(ipc_callid_t rid, ipc_call_t *request)
-{
-	int fd = IPC_GET_ARG1(*request);
-	int64_t size = MERGE_LOUP32(IPC_GET_ARG2(*request), IPC_GET_ARG3(*request));
-	int rc = vfs_op_truncate(fd, size);
 	async_answer_0(rid, rc);
 }
@@ -287,4 +287,7 @@
 			vfs_in_rename(callid, &call);
 			break;
+		case VFS_IN_RESIZE:
+			vfs_in_resize(callid, &call);
+			break;
 		case VFS_IN_STAT:
 			vfs_in_stat(callid, &call);
@@ -295,7 +298,4 @@
 		case VFS_IN_SYNC:
 			vfs_in_sync(callid, &call);
-			break;
-		case VFS_IN_TRUNCATE:
-			vfs_in_truncate(callid, &call);
 			break;
 		case VFS_IN_UNLINK:
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 79ea5af7eec765b8d511aeadc76b09d6eebb8be0)
+++ uspace/srv/vfs/vfs_ops.c	(revision 67e881c2df2e8f5baa2245037694234ab02d8efc)
@@ -585,4 +585,22 @@
 }
 
+int vfs_op_resize(int fd, int64_t size)
+{
+	vfs_file_t *file = vfs_file_get(fd);
+	if (!file)
+		return EBADF;
+
+	fibril_rwlock_write_lock(&file->node->contents_rwlock);
+	
+	int rc = vfs_truncate_internal(file->node->fs_handle,
+	    file->node->service_id, file->node->index, size);
+	if (rc == EOK)
+		file->node->size = size;
+	
+	fibril_rwlock_write_unlock(&file->node->contents_rwlock);
+	vfs_file_put(file);
+	return rc;
+}
+
 int vfs_op_stat(int fd)
 {
@@ -652,22 +670,4 @@
 	
 	return (int) rc;
-}
-
-int vfs_op_truncate(int fd, int64_t size)
-{
-	vfs_file_t *file = vfs_file_get(fd);
-	if (!file)
-		return EBADF;
-
-	fibril_rwlock_write_lock(&file->node->contents_rwlock);
-	
-	int rc = vfs_truncate_internal(file->node->fs_handle,
-	    file->node->service_id, file->node->index, size);
-	if (rc == EOK)
-		file->node->size = size;
-	
-	fibril_rwlock_write_unlock(&file->node->contents_rwlock);
-	vfs_file_put(file);
-	return rc;
 }
 
