Index: uspace/app/bdsh/scli.h
===================================================================
--- uspace/app/bdsh/scli.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/app/bdsh/scli.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -31,4 +31,5 @@
 
 #include "config.h"
+#include <errno.h>
 #include <stdint.h>
 #include <stdio.h>
Index: uspace/app/sbi/src/os/os.h
===================================================================
--- uspace/app/sbi/src/os/os.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/app/sbi/src/os/os.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -30,4 +30,6 @@
 #define OS_H_
 
+#include <errno.h>
+
 char *os_str_acat(const char *a, const char *b);
 char *os_str_aslice(const char *str, size_t start, size_t length);
Index: uspace/app/untar/main.c
===================================================================
--- uspace/app/untar/main.c	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/app/untar/main.c	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -33,4 +33,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdarg.h>
Index: uspace/lib/bithenge/include/bithenge/os.h
===================================================================
--- uspace/lib/bithenge/include/bithenge/os.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/bithenge/include/bithenge/os.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -33,4 +33,5 @@
 
 #ifdef __HELENOS__
+#include <stdint.h>
 typedef int64_t bithenge_int_t;
 #define BITHENGE_PRId PRId64
Index: uspace/lib/c/generic/elf/elf.c
===================================================================
--- uspace/lib/c/generic/elf/elf.c	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/c/generic/elf/elf.c	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -27,7 +27,7 @@
  */
 
+#include <assert.h>
 #include <elf/elf.h>
-
-#include <assert.h>
+#include <stdbool.h>
 #include <stdlib.h>
 
Index: uspace/lib/c/generic/strtol.c
===================================================================
--- uspace/lib/c/generic/strtol.c	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/c/generic/strtol.c	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -37,9 +37,11 @@
  */
 
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
 #include <inttypes.h>
+#include <limits.h>
+#include <stdbool.h>
 #include <stdlib.h>
-#include <limits.h>
-#include <ctype.h>
-#include <assert.h>
 
 // TODO: unit tests
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/c/include/stdio.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -59,4 +59,7 @@
 #define BUFSIZ  4096
 
+/** Recommended size of fixed-size array for holding file names. */
+#define FILENAME_MAX 4096
+
 /** Forward declaration */
 struct _IO_FILE;
@@ -68,4 +71,5 @@
 
 /* Character and string input functions */
+#define getc fgetc
 extern int fgetc(FILE *);
 extern char *fgets(char *, int, FILE *);
@@ -74,4 +78,5 @@
 
 /* Character and string output functions */
+#define putc fputc
 extern int fputc(int, FILE *);
 extern int fputs(const char *, FILE *);
@@ -96,6 +101,8 @@
 extern int snprintf(char *, size_t, const char *, ...)
     _HELENOS_PRINTF_ATTRIBUTE(3, 4);
+#if defined(_HELENOS_SOURCE) || defined(_GNU_SOURCE)
 extern int vasprintf(char **, const char *, va_list);
 extern int asprintf(char **, const char *, ...)
+#endif
     _HELENOS_PRINTF_ATTRIBUTE(2, 3);
 extern int vsnprintf(char *, size_t, const char *, va_list);
@@ -137,4 +144,7 @@
 #define _IOLBF 1
 #define _IOFBF 2
+
+extern char *gets(char *, size_t);
+
 #endif
 
@@ -168,5 +178,4 @@
 extern FILE *fdopen(int, const char *);
 extern int fileno(FILE *);
-extern char *gets(char *, size_t);
 
 #include <offset.h>
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/c/include/stdlib.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -38,7 +38,9 @@
 #include <malloc.h>
 #include <qsort.h>
-#include <stacktrace.h>
 
 #define RAND_MAX  714025
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
 
 extern int rand(void);
Index: uspace/lib/posix/include/posix/stdio.h
===================================================================
--- uspace/lib/posix/include/posix/stdio.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/posix/include/posix/stdio.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -40,5 +40,4 @@
 
 #include "stddef.h"
-#include "unistd.h"
 #include "libc/io/verify.h"
 #include "sys/types.h"
@@ -46,71 +45,6 @@
 #include "limits.h"
 
-/*
- * These are the same as in HelenOS libc.
- * It would be possible to directly include <stdio.h> but
- * it is better not to pollute POSIX namespace with other functions
- * defined in that header.
- *
- * Because libposix is always linked with libc, providing only these
- * forward declarations ought to be enough.
- */
-#define EOF (-1)
-
-/** Size of buffers used in stdio header. */
-#define BUFSIZ  4096
-
-/** Maximum size in bytes of the longest filename. */
-#define FILENAME_MAX 4096
-
-typedef struct _IO_FILE FILE;
-
-extern FILE *stdin;
-extern FILE *stdout;
-extern FILE *stderr;
-
-extern int fgetc(FILE *);
-extern char *fgets(char *, int, FILE *);
-
-extern int getchar(void);
-extern char *gets(char *, size_t);
-
-extern int fputc(int, FILE *);
-extern int fputs(const char *, FILE *);
-
-extern int putchar(int);
-extern int puts(const char *);
-
-extern int fprintf(FILE *, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
-extern int vfprintf(FILE *, const char *, va_list);
-
-extern int printf(const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(1, 2);
-extern int vprintf(const char *, va_list);
-
-extern int snprintf(char *, size_t, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(3, 4);
-#ifdef _GNU_SOURCE
-extern int vasprintf(char **, const char *, va_list);
-extern int asprintf(char **, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(2, 3);
-#endif
-extern int vsnprintf(char *, size_t, const char *, va_list);
-
-extern FILE *fopen(const char *, const char *);
 extern FILE *fdopen(int, const char *);
-extern int fclose(FILE *);
-
-extern size_t fread(void *, size_t, size_t, FILE *);
-extern size_t fwrite(const void *, size_t, size_t, FILE *);
-
-extern void rewind(FILE *);
-extern int feof(FILE *);
 extern int fileno(FILE *);
-
-extern int fflush(FILE *);
-extern int ferror(FILE *);
-extern void clearerr(FILE *);
-
-extern void setvbuf(FILE *, void *, int, size_t);
-extern void setbuf(FILE *, void *);
-
-/* POSIX specific stuff. */
 
 /* Identifying the Terminal */
@@ -119,22 +53,9 @@
 extern char *ctermid(char *s);
 
-/* Error Recovery */
-extern void clearerr(FILE *stream);
-
 /* Input/Output */
-#undef putc
-#define putc fputc
-extern int fputs(const char *__restrict__ s, FILE *__restrict__ stream);
-#undef getc
-#define getc fgetc
-extern int ungetc(int c, FILE *stream);
 extern ssize_t getdelim(char **__restrict__ lineptr, size_t *__restrict__ n,
     int delimiter, FILE *__restrict__ stream);
 extern ssize_t getline(char **__restrict__ lineptr, size_t *__restrict__ n,
     FILE *__restrict__ stream);
-
-/* Opening Streams */
-extern FILE *freopen(const char *__restrict__ filename,
-    const char *__restrict__ mode, FILE *__restrict__ stream);
 
 /* Error Messages */
@@ -148,11 +69,6 @@
 extern int fsetpos(FILE *stream, const fpos_t *pos);
 extern int fgetpos(FILE *__restrict__ stream, fpos_t *__restrict__ pos);
-extern int fseek(FILE *stream, long offset, int whence);
 extern int fseeko(FILE *stream, off_t offset, int whence);
-extern long ftell(FILE *stream);
 extern off_t ftello(FILE *stream);
-
-/* Flushing Buffers */
-extern int fflush(FILE *stream);
 
 /* Formatted Output */
@@ -173,10 +89,4 @@
 extern int putchar_unlocked(int c);
 
-/* Deleting Files */
-extern int remove(const char *path);
-
-/* Renaming Files */
-extern int rename(const char *oldname, const char *newname);
-
 /* Temporary Files */
 #undef L_tmpnam
@@ -186,5 +96,4 @@
 extern FILE *tmpfile(void);
 
-
 #endif /* POSIX_STDIO_H_ */
 
Index: uspace/lib/posix/include/posix/stdlib.h
===================================================================
--- uspace/lib/posix/include/posix/stdlib.h	(revision 1ae9c07ebd6809ba2f823b92d1cec45c208e2d48)
+++ uspace/lib/posix/include/posix/stdlib.h	(revision 55092672530a7c5f20b1e050bbe7c09cd6527df6)
@@ -37,19 +37,13 @@
 #define POSIX_STDLIB_H_
 
+#include "libc/stdlib.h"
 #include "sys/types.h"
 
 #include <_bits/NULL.h>
 
-#define RAND_MAX  714025
+/* Process Termination */
+#define _Exit exit
 
-/* Process Termination */
-#undef EXIT_FAILURE
-#define EXIT_FAILURE 1
-#undef EXIT_SUCCESS
-#define EXIT_SUCCESS 0
-#define _Exit exit
 extern int atexit(void (*func)(void));
-extern void exit(int status) __attribute__((noreturn));
-extern void abort(void) __attribute__((noreturn));
 
 /* Absolute Value */
@@ -77,6 +71,4 @@
 
 /* Array Functions */
-extern void qsort(void *array, size_t count, size_t size,
-    int (*compare)(const void *, const void *));
 extern void *bsearch(const void *key, const void *base,
     size_t nmemb, size_t size, int (*compar)(const void *, const void *));
@@ -96,32 +88,6 @@
 extern long double strtold(const char *__restrict__ nptr, char **__restrict__ endptr);
 
-/* Integer Conversion */
-extern int atoi(const char *nptr);
-extern long int atol(const char *nptr);
-extern long long int atoll(const char *nptr);
-extern long int strtol(const char *__restrict__ nptr,
-    char **__restrict__ endptr, int base);
-extern long long int strtoll(const char *__restrict__ nptr,
-    char **__restrict__ endptr, int base);
-extern unsigned long int strtoul(const char *__restrict__ nptr,
-    char **__restrict__ endptr, int base);
-extern unsigned long long int strtoull(
-    const char *__restrict__ nptr, char **__restrict__ endptr, int base);
-
-/* Memory Allocation */
-extern void *malloc(size_t size)
-    __attribute__((malloc));
-extern void *calloc(size_t nelem, size_t elsize)
-    __attribute__((malloc));
-extern void *realloc(void *ptr, size_t size)
-    __attribute__((warn_unused_result));
-extern void free(void *ptr);
-
 /* Temporary Files */
 extern int mkstemp(char *tmpl);
-
-/* Pseudo-random number generator */
-extern int rand(void);
-extern void srand(unsigned int seed);
 
 /* Legacy Declarations */
