Index: uspace/lib/libc/include/errno.h
===================================================================
--- uspace/lib/libc/include/errno.h	(revision 2616965d9d69521386f3383a104f633b74958797)
+++ uspace/lib/libc/include/errno.h	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
@@ -43,4 +43,5 @@
 #define ENOSPC		(-259)
 #define EEXIST		(-260)
+#define ENOTEMPTY	(-261)
 
 #endif
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 2616965d9d69521386f3383a104f633b74958797)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision 16105cbad5bcf0090ae35b2e23639a96cbe3b4f9)
@@ -188,5 +188,23 @@
 static int destroy_component(void *nodeptr)
 {
-	return EPERM;
+	tmpfs_dentry_t *dentry = (tmpfs_dentry_t *)nodeptr;
+
+	if (dentry->child)
+		return ENOTEMPTY;
+
+	if (!dentry->parent)
+		return EBUSY;
+
+	if (dentry->parent->child == dentry) {
+		dentry->parent->child = dentry->sibling;
+	} else {
+		/* TODO: consider doubly linked list for organizing siblings. */
+		tmpfs_dentry_t *tmp = dentry->parent->child;
+		while (tmp->sibling != dentry)
+			tmp = tmp->sibling;
+		tmp->sibling = dentry->sibling;
+	}
+
+	return EOK;
 }
 
@@ -314,5 +332,7 @@
 	if (lflag & L_DESTROY) {
 		int res = destroy_component(dcur);
-		ipc_answer_0(rid, res);
+		unsigned lnkcnt = (res == EOK) ? 0 : TMPFS_GET_LNKCNT(dcur);
+		ipc_answer_5(rid, (ipcarg_t)res, tmpfs_reg.fs_handle,
+		    dev_handle, dcur->index, dcur->size, lnkcnt);
 		return;
 	}
