Index: uspace/lib/c/generic/futex.c
===================================================================
--- uspace/lib/c/generic/futex.c	(revision 927a181ebf836ca4e18efcf32e0b11a9a8c69dc7)
+++ uspace/lib/c/generic/futex.c	(revision cb10bc9a558169f21c11cf80a9da8706c68bcdc3)
@@ -35,6 +35,4 @@
 #include <futex.h>
 #include <atomic.h>
-#include <libc.h>
-#include <sys/types.h>
 
 /** Initialize futex counter.
@@ -49,49 +47,4 @@
 }
 
-/** Try to down the futex.
- *
- * @param futex Futex.
- *
- * @return Non-zero if the futex was acquired.
- * @return Zero if the futex was not acquired.
- *
- */
-int futex_trydown(futex_t *futex)
-{
-	return cas(&futex->val, 1, 0);
-}
-
-/** Down the futex.
- *
- * @param futex Futex.
- *
- * @return ENOENT if there is no such virtual address.
- * @return Zero in the uncontended case.
- * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED.
- *
- */
-int futex_down(futex_t *futex)
-{
-	if ((atomic_signed_t) atomic_predec(&futex->val) < 0)
-		return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
-	
-	return 0;
-}
-
-/** Up the futex.
- *
- * @param futex Futex.
- *
- * @return ENOENT if there is no such virtual address.
- * @return Zero in the uncontended case.
- *
- */
-int futex_up(futex_t *futex)
-{
-	if ((atomic_signed_t) atomic_postinc(&futex->val) < 0)
-		return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
-	
-	return 0;
-}
 
 /** @}
Index: uspace/lib/c/include/futex.h
===================================================================
--- uspace/lib/c/include/futex.h	(revision 927a181ebf836ca4e18efcf32e0b11a9a8c69dc7)
+++ uspace/lib/c/include/futex.h	(revision cb10bc9a558169f21c11cf80a9da8706c68bcdc3)
@@ -38,4 +38,6 @@
 #include <atomic.h>
 #include <sys/types.h>
+#include <libc.h>
+
 
 #define FUTEX_INITIALIZER  {{1}}
@@ -45,8 +47,57 @@
 } futex_t;
 
+
 extern void futex_initialize(futex_t *futex, int value);
-extern int futex_down(futex_t *futex);
-extern int futex_trydown(futex_t *futex);
-extern int futex_up(futex_t *futex);
+
+#define futex_down(fut)     (void)_futex_down((fut))
+#define futex_trydown(fut)  _futex_trydown((fut))
+#define futex_up(fut)       (void)_futex_up((fut))
+
+
+/** Try to down the futex.
+ *
+ * @param futex Futex.
+ *
+ * @return Non-zero if the futex was acquired.
+ * @return Zero if the futex was not acquired.
+ *
+ */
+static inline int _futex_trydown(futex_t *futex)
+{
+	return cas(&futex->val, 1, 0);
+}
+
+/** Down the futex.
+ *
+ * @param futex Futex.
+ *
+ * @return ENOENT if there is no such virtual address.
+ * @return Zero in the uncontended case.
+ * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED.
+ *
+ */
+static inline int _futex_down(futex_t *futex)
+{
+	if ((atomic_signed_t) atomic_predec(&futex->val) < 0)
+		return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
+	
+	return 0;
+}
+
+/** Up the futex.
+ *
+ * @param futex Futex.
+ *
+ * @return ENOENT if there is no such virtual address.
+ * @return Zero in the uncontended case.
+ *
+ */
+static inline int _futex_up(futex_t *futex)
+{
+	if ((atomic_signed_t) atomic_postinc(&futex->val) < 0)
+		return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
+	
+	return 0;
+}
 
 #endif
