Index: uspace/lib/posix/sys/stat.h
===================================================================
--- uspace/lib/posix/sys/stat.h	(revision ad2859940999e2be90143375eac1da9a59b618eb)
+++ uspace/lib/posix/sys/stat.h	(revision e7f7c930327ee4da9c50b74f2cdf47de45266d0b)
@@ -40,4 +40,9 @@
 #include "types.h"
 #include "../time.h"
+#include <ipc/devmap.h>
+#include <task.h>
+
+typedef devmap_handle_t posix_dev_t;
+typedef task_id_t posix_pid_t;
 
 /* values are the same as on Linux */
@@ -134,4 +139,6 @@
 
 #ifndef LIBPOSIX_INTERNAL
+	#define dev_t posix_dev_t
+	#define pid_t posix_pid_t
 	#define fstat posix_fstat
 	#define lstat posix_lstat
Index: uspace/lib/posix/sys/types.h
===================================================================
--- uspace/lib/posix/sys/types.h	(revision ad2859940999e2be90143375eac1da9a59b618eb)
+++ uspace/lib/posix/sys/types.h	(revision e7f7c930327ee4da9c50b74f2cdf47de45266d0b)
@@ -38,9 +38,5 @@
 
 #include "../libc/sys/types.h"
-#include <ipc/devmap.h>
-#include <task.h>
 
-typedef task_id_t posix_pid_t;
-typedef devmap_handle_t posix_dev_t;
 typedef unsigned int posix_ino_t;
 typedef unsigned int posix_nlink_t;
@@ -52,6 +48,4 @@
 
 #ifndef LIBPOSIX_INTERNAL
-	#define pid_t posix_pid_t
-	#define dev_t posix_dev_t
 	#define nlink_t posix_nlink_t
 	#define uid_t posix_uid_t
