Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision d4ec49ec9742a9963af1545a2e50adf65802c994)
+++ uspace/lib/c/generic/task.c	(revision b22b0a94b341e922fce473e92cec4901af1e7086)
@@ -3,4 +3,5 @@
  * Copyright (c) 2008 Jiri Svoboda
  * Copyright (c) 2014 Martin Sucha
+ * Copyright (c) 2015 Michal Koutny
  * All rights reserved.
  *
@@ -53,4 +54,5 @@
 
 static async_sess_t *session_taskman = NULL;
+static task_event_handler_t task_event_handler = NULL;
 
 task_id_t task_get_id(void)
@@ -470,4 +472,9 @@
 }
 
+void task_set_event_handler(task_event_handler_t handler)
+{
+	task_event_handler = handler;
+	// TODO implement logic for calling the handler
+}
 
 void __task_init(async_sess_t *sess)
Index: uspace/lib/c/include/task.h
===================================================================
--- uspace/lib/c/include/task.h	(revision d4ec49ec9742a9963af1545a2e50adf65802c994)
+++ uspace/lib/c/include/task.h	(revision b22b0a94b341e922fce473e92cec4901af1e7086)
@@ -46,11 +46,4 @@
 #define TASK_WAIT_BOTH   0x4
 
-typedef struct {
-	int flags;
-	ipc_call_t result;
-	aid_t aid;
-	task_id_t tid;
-} task_wait_t;
-
 static inline void task_wait_set(task_wait_t *wait, int flags)
 {
@@ -76,19 +69,11 @@
     __attribute__((sentinel));
 
-// if there is possibility for further wait, modify task_wait
 extern errno_t task_wait(task_wait_t *, task_exit_t *, int *);
 extern errno_t task_wait_task_id(task_id_t, int, task_exit_t *, int *);
-// similar to listen and socket duplication
-extern errno_t task_wait_any(task_wait_t *, task_id_t *, task_exit_t *, int *,
-    task_wait_t *);
-
-//extern int task_wait_any(int, task_exit_t *, int *);
-// alternative
-// task_wait_t is output param, actual result is obtained via task_wait call
-//extern int task_wait_any(task_wait_t *, int);
 
 extern void task_cancel_wait(task_wait_t *);
 
 extern errno_t task_retval(int);
+extern void task_set_event_handler(task_event_handler_t);
 
 #endif
Index: uspace/lib/c/include/types/task.h
===================================================================
--- uspace/lib/c/include/types/task.h	(revision d4ec49ec9742a9963af1545a2e50adf65802c994)
+++ uspace/lib/c/include/types/task.h	(revision b22b0a94b341e922fce473e92cec4901af1e7086)
@@ -42,4 +42,13 @@
 } task_exit_t;
 
+typedef struct {
+	int flags;
+	ipc_call_t result;
+	aid_t aid;
+	task_id_t tid;
+} task_wait_t;
+
+typedef void (* task_event_handler_t)(task_id_t, int, task_exit_t, int);
+
 #endif
 
