Index: uspace/lib/posix/inttypes.h
===================================================================
--- uspace/lib/posix/inttypes.h	(revision fb90deb97a9150b88c9d015fcaaf33d2f1291e14)
+++ uspace/lib/posix/inttypes.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -36,5 +36,5 @@
 #define POSIX_INTTYPES_H_
 
-#include "libc/stdint.h"
+#include "stdint.h"
 #include "libc/inttypes.h"
 
Index: uspace/lib/posix/limits.h
===================================================================
--- uspace/lib/posix/limits.h	(revision fb90deb97a9150b88c9d015fcaaf33d2f1291e14)
+++ uspace/lib/posix/limits.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -36,4 +36,5 @@
 #define POSIX_LIMITS_H_
 
+#include "libc/stdint.h"
 #include "libc/sys/types.h"
 
Index: uspace/lib/posix/stddef.h
===================================================================
--- uspace/lib/posix/stddef.h	(revision fb90deb97a9150b88c9d015fcaaf33d2f1291e14)
+++ uspace/lib/posix/stddef.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -42,4 +42,6 @@
 #endif
 
+#define offsetof(type,member) ((size_t) &(((type *) 0)->member))
+
 typedef ssize_t posix_ptrdiff_t;
 
Index: uspace/lib/posix/stdint.h
===================================================================
--- uspace/lib/posix/stdint.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
+++ uspace/lib/posix/stdint.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2011 Petr Koupy
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libposix
+ * @{
+ */
+/** @file
+ */
+
+#ifndef POSIX_STDINT_H_
+#define POSIX_STDINT_H_
+
+#include "libc/stdint.h"
+
+typedef int64_t posix_intmax_t;
+typedef uint64_t posix_uintmax_t;
+
+// FIXME: should be integrated into build process similarly to uintptr_t
+typedef ssize_t posix_intptr_t;
+
+#ifndef LIBPOSIX_INTERNAL
+	#define intmax_t posix_intmax_t
+	#define uintmax_t posix_uintmax_t
+
+	#define intptr_t posix_intptr_t
+#endif
+
+#endif /* POSIX_STDINT_H_ */
+
+/** @}
+ */
Index: uspace/lib/posix/string.h
===================================================================
--- uspace/lib/posix/string.h	(revision fb90deb97a9150b88c9d015fcaaf33d2f1291e14)
+++ uspace/lib/posix/string.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -102,4 +102,7 @@
 extern size_t posix_strnlen(const char *s, size_t n);
 
+/* Legacy declarations */
+extern int posix_ffs(int i);
+
 #ifndef LIBPOSIX_INTERNAL
 	#define strcpy posix_strcpy
@@ -134,4 +137,6 @@
 	#define strlen posix_strlen
 	#define strnlen posix_strnlen
+
+	#define ffs posix_ffs
 #endif
 
Index: uspace/lib/posix/unistd.c
===================================================================
--- uspace/lib/posix/unistd.c	(revision fb90deb97a9150b88c9d015fcaaf33d2f1291e14)
+++ uspace/lib/posix/unistd.c	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -38,4 +38,7 @@
 #include "internal/common.h"
 #include "unistd.h"
+
+/* Array of environment variable strings (NAME=VALUE). */
+char **environ = NULL;
 
 /**
Index: uspace/lib/posix/unistd.h
===================================================================
--- uspace/lib/posix/unistd.h	(revision fb90deb97a9150b88c9d015fcaaf33d2f1291e14)
+++ uspace/lib/posix/unistd.h	(revision b4d625240d3c62c679c3e4318d1077684642e2f1)
@@ -48,4 +48,7 @@
 extern int getopt(int, char * const [], const char *);
 
+/* Environmental Variables */
+extern char **posix_environ;
+
 /* Identifying Terminals */
 extern int posix_isatty(int fd);
@@ -85,4 +88,6 @@
 
 #ifndef LIBPOSIX_INTERNAL
+	#define environ posix_environ
+
 	#define isatty posix_isatty
 
