Index: uspace/libc/generic/thread.c
===================================================================
--- uspace/libc/generic/thread.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
+++ uspace/libc/generic/thread.c	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -125,8 +125,9 @@
  * @param arg Argument to be passed to thread.
  * @param name Symbolic name of the thread.
- *
- * @return TID of the new thread on success or -1 on failure.
- */
-int thread_create(void (* function)(void *), void *arg, char *name)
+ * @param tid Thread ID of the newly created thread.
+ *
+ * @return Zero on success or a code from @ref errno.h on failure.
+ */
+int thread_create(void (* function)(void *), void *arg, char *name, thread_id_t *tid)
 {
 	char *stack;
@@ -149,5 +150,5 @@
 	uarg->uspace_uarg = uarg;
 	
-	return __SYSCALL2(SYS_THREAD_CREATE, (sysarg_t) uarg, (sysarg_t) name);
+	return __SYSCALL3(SYS_THREAD_CREATE, (sysarg_t) uarg, (sysarg_t) name, (sysarg_t) tid);
 }
 
@@ -167,5 +168,5 @@
  * @param thread TID.
  */
-void thread_detach(int thread)
+void thread_detach(thread_id_t thread)
 {
 }
@@ -179,5 +180,5 @@
  * @return Thread exit status.
  */
-int thread_join(int thread)
+int thread_join(thread_id_t thread)
 {
 }
@@ -187,7 +188,11 @@
  * @return Current thread ID.
  */
-int thread_get_id(void)
-{
-	return __SYSCALL0(SYS_THREAD_GET_ID);
+thread_id_t thread_get_id(void)
+{
+	thread_id_t thread_id;
+
+	(void) __SYSCALL1(SYS_THREAD_GET_ID, (sysarg_t) &thread_id);
+
+	return thread_id;
 }
 
Index: uspace/libc/include/thread.h
===================================================================
--- uspace/libc/include/thread.h	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
+++ uspace/libc/include/thread.h	(revision 7cb567cd74caf371a5b1b053095a12b9bd1704a6)
@@ -40,12 +40,14 @@
 #include <types.h>
 
+typedef uint64_t thread_id_t;
+
 extern void __thread_entry(void);
 extern void __thread_main(uspace_arg_t *uarg);
 
-extern int thread_create(void (* function)(void *arg), void *arg, char *name);
+extern int thread_create(void (* function)(void *), void *arg, char *name, thread_id_t *tid);
 extern void thread_exit(int status);
-extern void thread_detach(int thread);
-extern int thread_join(int thread);
-extern int thread_get_id(void);
+extern void thread_detach(thread_id_t thread);
+extern int thread_join(thread_id_t thread);
+extern thread_id_t thread_get_id(void);
 extern tcb_t * __make_tls(void);
 extern tcb_t * __alloc_tls(void **data, size_t size);
