Index: generic/src/proc/task.c
===================================================================
--- generic/src/proc/task.c	(revision cf26ba925149372793f1ad55138490f8190259e4)
+++ generic/src/proc/task.c	(revision 2bb8648e46a151efe13c3bb8385ced857a95758d)
@@ -49,5 +49,5 @@
 #include <print.h>
 #include <elf.h>
-
+#include <syscall/copy.h>
 
 #ifndef LOADED_PROG_STACK_PAGES_NO
@@ -171,5 +171,5 @@
  * @param uspace_task_id Userspace address of 8-byte buffer where to store current task ID.
  *
- * @return Always returns 0.
+ * @return 0 on success or an error code from @ref errno.h.
  */
 __native sys_task_get_id(task_id_t *uspace_task_id)
@@ -179,7 +179,5 @@
 	 * remains constant for the lifespan of the task.
 	 */
-	copy_to_uspace(uspace_task_id, &TASK->taskid, sizeof(TASK->taskid));
-
-	return 0;
+	return (__native) copy_to_uspace(uspace_task_id, &TASK->taskid, sizeof(TASK->taskid));
 }
 
Index: generic/src/proc/thread.c
===================================================================
--- generic/src/proc/thread.c	(revision cf26ba925149372793f1ad55138490f8190259e4)
+++ generic/src/proc/thread.c	(revision 2bb8648e46a151efe13c3bb8385ced857a95758d)
@@ -61,4 +61,6 @@
 #include <debug.h>
 #include <main/uinit.h>
+#include <syscall/copy.h>
+#include <errno.h>
 
 char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */
@@ -304,4 +306,7 @@
 	t->sleep_queue = NULL;
 	t->timeout_pending = 0;
+
+	t->in_copy_from_uspace = false;
+	t->in_copy_to_uspace = false;
 	
 	t->rwlock_holder_type = RWLOCK_NONE;
@@ -463,9 +468,16 @@
 	uspace_arg_t *kernel_uarg;
 	__u32 tid;
-
-	copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN);
+	int rc;
+
+	rc = copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN);
+	if (rc != 0)
+		return (__native) rc;
 
 	kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0);	
-	copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t));
+	rc = copy_from_uspace(kernel_uarg, uspace_uarg, sizeof(uspace_arg_t));
+	if (rc != 0) {
+		free(kernel_uarg);
+		return (__native) rc;
+	}
 
 	if ((t = thread_create(uinit, kernel_uarg, TASK, 0, namebuf))) {
@@ -477,5 +489,5 @@
 	}
 
-	return (__native) -1;
+	return (__native) ENOMEM;
 }
 
