Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/Makefile	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -85,4 +85,5 @@
 	generic/str.c \
 	generic/str_error.c \
+	generic/strtol.c \
 	generic/l18n/langs.c \
 	generic/fibril.c \
Index: uspace/lib/c/arch/ia32/include/libarch/syscall.h
===================================================================
--- uspace/lib/c/arch/ia32/include/libarch/syscall.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/arch/ia32/include/libarch/syscall.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -48,5 +48,5 @@
 #define __syscall6  __syscall_slow
 
-extern sysarg_t (* __syscall_fast_func)(const sysarg_t, const sysarg_t,
+extern sysarg_t (*__syscall_fast_func)(const sysarg_t, const sysarg_t,
     const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t,
     const syscall_t);
Index: uspace/lib/c/arch/ia32/src/rtld/reloc.c
===================================================================
--- uspace/lib/c/arch/ia32/src/rtld/reloc.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/arch/ia32/src/rtld/reloc.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -38,4 +38,5 @@
 #include <stdlib.h>
 #include <inttypes.h>
+#include <str.h>
 
 #include <libarch/rtld/elf_dyn.h>
Index: uspace/lib/c/generic/getopt.c
===================================================================
--- uspace/lib/c/generic/getopt.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/getopt.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -49,5 +49,5 @@
 int	optopt = '?';		/* character checked for validity */
 int	optreset;		/* reset getopt */
-const char *optarg;		/* argument associated with option */
+char	*optarg;		/* argument associated with option */
 
 
@@ -67,5 +67,5 @@
 #define INORDER (int)1
 
-#define	EMSG	""
+static char EMSG[] = "";
 
 static int getopt_internal(int, char **, const char *);
@@ -73,5 +73,5 @@
 static void permute_args(int, int, int, char **);
 
-static const char *place = EMSG; /* option letter processing */
+static char *place = EMSG; /* option letter processing */
 
 /* XXX: set optreset to 1 rather than these two */
@@ -336,5 +336,5 @@
 	if (retval == -2) {
 		char *current_argv;
-		const char *has_equal;
+		char *has_equal;
 		size_t current_argv_len;
 		int i, ambiguous, match;
Index: uspace/lib/c/generic/inet/addr.c
===================================================================
--- uspace/lib/c/generic/inet/addr.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/inet/addr.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -42,4 +42,5 @@
 #include <bitops.h>
 #include <inttypes.h>
+#include <str.h>
 
 #define INET_PREFIXSTRSIZE  5
Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/io/io.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -799,5 +799,5 @@
 }
 
-int fseek(FILE *stream, long offset, int whence)
+int fseek64(FILE *stream, off64_t offset, int whence)
 {
 	errno_t rc;
@@ -814,5 +814,5 @@
 	stream->ungetc_chars = 0;
 
-	struct stat st;
+	vfs_stat_t st;
 	switch (whence) {
 	case SEEK_SET:
@@ -837,10 +837,6 @@
 }
 
-long ftell(FILE *stream)
-{
-	/* The native position is too large for the C99-ish interface. */
-	if (stream->pos - stream->ungetc_chars > LONG_MAX)
-		return EOF;
-
+off64_t ftell64(FILE *stream)
+{
 	if (stream->error)
 		return EOF;
@@ -853,4 +849,20 @@
 
 	return stream->pos - stream->ungetc_chars;
+}
+
+int fseek(FILE *stream, long offset, int whence)
+{
+	return fseek64(stream, offset, whence);
+}
+
+long ftell(FILE *stream)
+{
+	off64_t off = ftell64(stream);
+
+	/* The native position is too large for the C99-ish interface. */
+	if (off > LONG_MAX)
+		return EOF;
+
+	return off;
 }
 
Index: uspace/lib/c/generic/io/log.c
===================================================================
--- uspace/lib/c/generic/io/log.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/io/log.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -41,4 +41,5 @@
 #include <io/log.h>
 #include <ipc/logger.h>
+#include <str.h>
 #include <ns.h>
 
Index: uspace/lib/c/generic/io/table.c
===================================================================
--- uspace/lib/c/generic/io/table.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/io/table.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -40,4 +40,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 
 static table_column_t *table_column_first(table_t *);
Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/malloc.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -33,6 +33,4 @@
 /** @file
  */
-
-#define _HELENOS_SOURCE
 
 #include <malloc.h>
@@ -876,6 +874,11 @@
  *
  */
-void *realloc(const void *addr, const size_t size)
-{
+void *realloc(void * const addr, const size_t size)
+{
+	if (size == 0) {
+		free(addr);
+		return NULL;
+	}
+
 	if (addr == NULL)
 		return malloc(size);
@@ -985,5 +988,5 @@
  *
  */
-void free(const void *addr)
+void free(void * const addr)
 {
 	if (addr == NULL)
Index: uspace/lib/c/generic/rtld/dynamic.c
===================================================================
--- uspace/lib/c/generic/rtld/dynamic.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/rtld/dynamic.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -37,4 +37,5 @@
 #include <stdio.h>
 #include <inttypes.h>
+#include <str.h>
 
 #include <rtld/elf_dyn.h>
Index: uspace/lib/c/generic/rtld/module.c
===================================================================
--- uspace/lib/c/generic/rtld/module.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/rtld/module.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -41,4 +41,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 
 #include <rtld/rtld.h>
Index: uspace/lib/c/generic/rtld/rtld.c
===================================================================
--- uspace/lib/c/generic/rtld/rtld.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/rtld/rtld.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -40,4 +40,5 @@
 #include <rtld/rtld_debug.h>
 #include <stdlib.h>
+#include <str.h>
 
 rtld_t *runtime_env;
Index: uspace/lib/c/generic/rtld/symbol.c
===================================================================
--- uspace/lib/c/generic/rtld/symbol.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/rtld/symbol.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -37,4 +37,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 
 #include <elf/elf.h>
Index: uspace/lib/c/generic/stdlib.c
===================================================================
--- uspace/lib/c/generic/stdlib.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/stdlib.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -35,12 +35,12 @@
 #include <stdlib.h>
 
-static long glbl_seed = 1;
+static int glbl_seed = 1;
 
-long int random(void)
+int rand(void)
 {
 	return glbl_seed = ((1366 * glbl_seed + 150889) % RAND_MAX);
 }
 
-void srandom(unsigned int seed)
+void srand(unsigned int seed)
 {
 	glbl_seed = seed % RAND_MAX;
Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/str.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -1273,128 +1273,4 @@
 }
 
-/** Convert string to a number.
- * Core of strtol and strtoul functions.
- *
- * @param nptr		Pointer to string.
- * @param endptr	If not NULL, function stores here pointer to the first
- * 			invalid character.
- * @param base		Zero or number between 2 and 36 inclusive.
- * @param sgn		It's set to 1 if minus found.
- * @return		Result of conversion.
- */
-static unsigned long
-_strtoul(const char *nptr, char **endptr, int base, char *sgn)
-{
-	unsigned char c;
-	unsigned long result = 0;
-	unsigned long a, b;
-	const char *str = nptr;
-	const char *tmpptr;
-	
-	while (isspace(*str))
-		str++;
-	
-	if (*str == '-') {
-		*sgn = 1;
-		++str;
-	} else if (*str == '+')
-		++str;
-	
-	if (base) {
-		if ((base == 1) || (base > 36)) {
-			/* FIXME: set errno to EINVAL */
-			return 0;
-		}
-		if ((base == 16) && (*str == '0') && ((str[1] == 'x') ||
-		    (str[1] == 'X'))) {
-			str += 2;
-		}
-	} else {
-		base = 10;
-		
-		if (*str == '0') {
-			base = 8;
-			if ((str[1] == 'X') || (str[1] == 'x'))  {
-				base = 16;
-				str += 2;
-			}
-		}
-	}
-	
-	tmpptr = str;
-
-	while (*str) {
-		c = *str;
-		c = (c >= 'a' ? c - 'a' + 10 : (c >= 'A' ? c - 'A' + 10 :
-		    (c <= '9' ? c - '0' : 0xff)));
-		if (c >= base) {
-			break;
-		}
-		
-		a = (result & 0xff) * base + c;
-		b = (result >> 8) * base + (a >> 8);
-		
-		if (b > (ULONG_MAX >> 8)) {
-			/* overflow */
-			/* FIXME: errno = ERANGE*/
-			return ULONG_MAX;
-		}
-	
-		result = (b << 8) + (a & 0xff);
-		++str;
-	}
-	
-	if (str == tmpptr) {
-		/*
-		 * No number was found => first invalid character is the first
-		 * character of the string.
-		 */
-		/* FIXME: set errno to EINVAL */
-		str = nptr;
-		result = 0;
-	}
-	
-	if (endptr)
-		*endptr = (char *) str;
-
-	if (nptr == str) {
-		/*FIXME: errno = EINVAL*/
-		return 0;
-	}
-
-	return result;
-}
-
-/** Convert initial part of string to long int according to given base.
- * The number may begin with an arbitrary number of whitespaces followed by
- * optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be
- * inserted and the number will be taken as hexadecimal one. If the base is 0
- * and the number begin with a zero, number will be taken as octal one (as with
- * base 8). Otherwise the base 0 is taken as decimal.
- *
- * @param nptr		Pointer to string.
- * @param endptr	If not NULL, function stores here pointer to the first
- * 			invalid character.
- * @param base		Zero or number between 2 and 36 inclusive.
- * @return		Result of conversion.
- */
-long int strtol(const char *nptr, char **endptr, int base)
-{
-	char sgn = 0;
-	unsigned long number = 0;
-	
-	number = _strtoul(nptr, endptr, base, &sgn);
-
-	if (number > LONG_MAX) {
-		if ((sgn) && (number == (unsigned long) (LONG_MAX) + 1)) {
-			/* FIXME: set 0 to errno */
-			return number;
-		}
-		/* FIXME: set ERANGE to errno */
-		return (sgn ? LONG_MIN : LONG_MAX);
-	}
-	
-	return (sgn ? -number : number);
-}
 
 /** Duplicate string.
@@ -1457,27 +1333,4 @@
 	str_ncpy(dest, size + 1, src, size);
 	return dest;
-}
-
-/** Convert initial part of string to unsigned long according to given base.
- * The number may begin with an arbitrary number of whitespaces followed by
- * optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be
- * inserted and the number will be taken as hexadecimal one. If the base is 0
- * and the number begin with a zero, number will be taken as octal one (as with
- * base 8). Otherwise the base 0 is taken as decimal.
- *
- * @param nptr		Pointer to string.
- * @param endptr	If not NULL, function stores here pointer to the first
- * 			invalid character
- * @param base		Zero or number between 2 and 36 inclusive.
- * @return		Result of conversion.
- */
-unsigned long strtoul(const char *nptr, char **endptr, int base)
-{
-	char sgn = 0;
-	unsigned long number = 0;
-	
-	number = _strtoul(nptr, endptr, base, &sgn);
-
-	return (sgn ? -number : number);
 }
 
Index: uspace/lib/c/generic/strtol.c
===================================================================
--- uspace/lib/c/generic/strtol.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
+++ uspace/lib/c/generic/strtol.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2005 Martin Decky
+ * Copyright (c) 2008 Jiri Svoboda
+ * Copyright (c) 2011 Martin Sucha
+ * Copyright (c) 2011 Oleg Romanenko
+ * Copyright (c) 2011 Jiri Zarevucky
+ * 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 libc
+ * @{
+ */
+/** @file
+ */
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <ctype.h>
+#include <assert.h>
+
+// TODO: unit tests
+
+static inline int _digit_value(int c)
+{
+	if (isdigit(c)) {
+		return c - '0';
+	} else if (islower(c)) {
+		return c - 'a' + 10;
+	} else if (isupper(c)) {
+		return c - 'A' + 10;
+	}
+	return INT_MAX;
+}
+
+/* FIXME: workaround for GCC "optimizing" the overflow check
+ * into soft-emulated 128b multiplication using `__multi3`,
+ * which we don't currently implement.
+ */
+__attribute__((noinline)) static uintmax_t _max_value(int base)
+{
+	return UINTMAX_MAX / base;
+}
+
+static inline uintmax_t _strtoumax(
+    const char *restrict nptr, char **restrict endptr, int base,
+    bool *restrict sgn)
+{
+	assert(nptr != NULL);
+	assert(sgn != NULL);
+
+	/* Skip leading whitespace. */
+
+	while (isspace(*nptr)) {
+		nptr++;
+	}
+
+	/* Parse sign, if any. */
+
+	switch (*nptr) {
+	case '-':
+		*sgn = true;
+		nptr++;
+		break;
+	case '+':
+		nptr++;
+		break;
+	}
+
+	/* Figure out the base. */
+
+	if (base == 0) {
+		if (*nptr == '0') {
+			if (tolower(nptr[1]) == 'x') {
+				/* 0x... is hex. */
+				base = 16;
+				nptr += 2;
+			} else {
+				/* 0... is octal. */
+				base = 8;
+			}
+		} else {
+			/* Anything else is decimal by default. */
+			base = 10;
+		}
+	} else if (base == 16) {
+		/* Allow hex number to be prefixed with "0x". */
+		if (nptr[0] == '0' && tolower(nptr[1]) == 'x') {
+			nptr += 2;
+		}
+	} else if (base < 0 || base == 1 || base > 36) {
+		errno = EINVAL;
+		return 0;
+	}
+
+	/* Read the value. */
+
+	uintmax_t result = 0;
+	uintmax_t max = _max_value(base);
+	int digit;
+
+	while (digit = _digit_value(*nptr), digit < base) {
+
+		if (result > max ||
+		    __builtin_add_overflow(result * base, digit, &result)) {
+
+			errno = ERANGE;
+			result = UINTMAX_MAX;
+			break;
+		}
+
+		nptr++;
+	}
+
+	/* Set endptr. */
+
+	if (endptr != NULL) {
+		/* Move the pointer to the end of the number,
+		 * in case it isn't there already.
+		 */
+		while (_digit_value(*nptr) < base) {
+			nptr++;
+		}
+
+		*endptr = (char *) nptr;
+	}
+
+	return result;
+}
+
+static inline intmax_t _strtosigned(const char *nptr, char **endptr, int base,
+    intmax_t min, intmax_t max)
+{
+	bool sgn = false;
+	uintmax_t number = _strtoumax(nptr, endptr, base, &sgn);
+
+	if (number > (uintmax_t) max) {
+		if (sgn && (number - 1 == (uintmax_t) max)) {
+			return min;
+		}
+
+		errno = ERANGE;
+		return (sgn ? min : max);
+	}
+
+	return (sgn ? -number : number);
+}
+
+static inline uintmax_t _strtounsigned(const char *nptr, char **endptr, int base,
+    uintmax_t max)
+{
+	bool sgn = false;
+	uintmax_t number = _strtoumax(nptr, endptr, base, &sgn);
+
+	if (sgn) {
+		if (number == 0) {
+			return 0;
+		} else {
+			errno = ERANGE;
+			return max;
+		}
+	}
+
+	if (number > max) {
+		errno = ERANGE;
+		return max;
+	}
+
+	return number;
+}
+
+/** Convert initial part of string to long int according to given base.
+ * The number may begin with an arbitrary number of whitespaces followed by
+ * optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be
+ * inserted and the number will be taken as hexadecimal one. If the base is 0
+ * and the number begin with a zero, number will be taken as octal one (as with
+ * base 8). Otherwise the base 0 is taken as decimal.
+ *
+ * @param nptr		Pointer to string.
+ * @param[out] endptr	If not NULL, function stores here pointer to the first
+ * 			invalid character.
+ * @param base		Zero or number between 2 and 36 inclusive.
+ * @return		Result of conversion.
+ */
+long strtol(const char *nptr, char **endptr, int base)
+{
+	return _strtosigned(nptr, endptr, base, LONG_MIN, LONG_MAX);
+}
+
+/** Convert initial part of string to unsigned long according to given base.
+ * The number may begin with an arbitrary number of whitespaces followed by
+ * optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be
+ * inserted and the number will be taken as hexadecimal one. If the base is 0
+ * and the number begin with a zero, number will be taken as octal one (as with
+ * base 8). Otherwise the base 0 is taken as decimal.
+ *
+ * @param nptr		Pointer to string.
+ * @param[out] endptr	If not NULL, function stores here pointer to the first
+ * 			invalid character
+ * @param base		Zero or number between 2 and 36 inclusive.
+ * @return		Result of conversion.
+ */
+unsigned long strtoul(const char *nptr, char **endptr, int base)
+{
+	return _strtounsigned(nptr, endptr, base, ULONG_MAX);
+}
+
+long long strtoll(const char *nptr, char **endptr, int base)
+{
+	return _strtosigned(nptr, endptr, base, LLONG_MIN, LLONG_MAX);
+}
+
+unsigned long long strtoull(const char *nptr, char **endptr, int base)
+{
+	return _strtounsigned(nptr, endptr, base, ULLONG_MAX);
+}
+
+intmax_t strtoimax(const char *nptr, char **endptr, int base)
+{
+	return _strtosigned(nptr, endptr, base, INTMAX_MIN, INTMAX_MAX);
+}
+
+uintmax_t strtoumax(const char *nptr, char **endptr, int base)
+{
+	return _strtounsigned(nptr, endptr, base, UINTMAX_MAX);
+}
+
+int atoi(const char *nptr)
+{
+	return (int)strtol(nptr, NULL, 10);
+}
+
+long atol(const char *nptr)
+{
+	return strtol(nptr, NULL, 10);
+}
+
+long long atoll(const char *nptr)
+{
+	return strtoll(nptr, NULL, 10);
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/uuid.c
===================================================================
--- uspace/lib/c/generic/uuid.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/uuid.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -52,8 +52,8 @@
 	/* XXX This is a rather poor way of generating random numbers */
 	gettimeofday(&tv, NULL);
-	srandom(tv.tv_sec ^ tv.tv_usec);
+	srand(tv.tv_sec ^ tv.tv_usec);
 
 	for (i = 0; i < uuid_bytes; i++)
-		uuid->b[i] = random();
+		uuid->b[i] = rand();
 
 	/* Version 4 UUID from random or pseudo-random numbers */
Index: uspace/lib/c/generic/vfs/mtab.c
===================================================================
--- uspace/lib/c/generic/vfs/mtab.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/vfs/mtab.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -40,6 +40,7 @@
 #include <errno.h>
 #include <assert.h>
+#include <str.h>
 
-static void process_mp(const char *path, struct stat *stat, list_t *mtab_list)
+static void process_mp(const char *path, vfs_stat_t *stat, list_t *mtab_list)
 {
 	mtab_ent_t *ent;
@@ -53,5 +54,5 @@
 	ent->service_id = stat->service_id;
 
-	struct statfs stfs;
+	vfs_statfs_t stfs;
 	if (vfs_statfs_path(path, &stfs) == EOK)
 		str_cpy(ent->fs_name, sizeof(ent->fs_name), stfs.fs_name);
@@ -74,5 +75,5 @@
 	while ((dirent = readdir(dir)) != NULL) {
 		char *child;
-		struct stat st;
+		vfs_stat_t st;
 		errno_t rc;
 		int ret;
@@ -122,5 +123,5 @@
 errno_t vfs_get_mtab_list(list_t *mtab_list)
 {
-	struct stat st;
+	vfs_stat_t st;
 
 	errno_t rc = vfs_stat_path("/", &st);
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -352,5 +352,5 @@
 async_sess_t *vfs_fd_session(int file, iface_t iface)
 {
-	struct stat stat;
+	vfs_stat_t stat;
 	errno_t rc = vfs_stat(file, &stat);
 	if (rc != EOK)
@@ -1052,5 +1052,5 @@
  * @return              EOK on success or an error code
  */
-errno_t vfs_stat(int file, struct stat *stat)
+errno_t vfs_stat(int file, vfs_stat_t *stat)
 {
 	errno_t rc;
@@ -1060,5 +1060,5 @@
 	
 	req = async_send_1(exch, VFS_IN_STAT, file, NULL);
-	rc = async_data_read_start(exch, (void *) stat, sizeof(struct stat));
+	rc = async_data_read_start(exch, (void *) stat, sizeof(vfs_stat_t));
 	if (rc != EOK) {
 		vfs_exchange_end(exch);
@@ -1086,5 +1086,5 @@
  * @return              EOK on success or an error code
  */
-errno_t vfs_stat_path(const char *path, struct stat *stat)
+errno_t vfs_stat_path(const char *path, vfs_stat_t *stat)
 {
 	int file;
@@ -1107,5 +1107,5 @@
  * @return              EOK on success or an error code
  */
-errno_t vfs_statfs(int file, struct statfs *st)
+errno_t vfs_statfs(int file, vfs_statfs_t *st)
 {
 	errno_t rc, ret;
@@ -1132,5 +1132,5 @@
  * @return              EOK on success or an error code
  */
-errno_t vfs_statfs_path(const char *path, struct statfs *st)
+errno_t vfs_statfs_path(const char *path, vfs_statfs_t *st)
 {
 	int file;
Index: uspace/lib/c/include/adt/hash_table.h
===================================================================
--- uspace/lib/c/include/adt/hash_table.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/adt/hash_table.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -84,6 +84,6 @@
 	member_to_inst((item), type, member)
 
-extern bool hash_table_create(hash_table_t *, size_t, size_t, 
-	hash_table_ops_t *);
+extern bool hash_table_create(hash_table_t *, size_t, size_t,
+    hash_table_ops_t *);
 extern void hash_table_destroy(hash_table_t *);
 
@@ -98,6 +98,6 @@
 extern size_t hash_table_remove(hash_table_t *, void *);
 extern void hash_table_remove_item(hash_table_t *, ht_link_t *);
-extern void hash_table_apply(hash_table_t *, bool (*)(ht_link_t *, void *), 
-	void *);
+extern void hash_table_apply(hash_table_t *, bool (*)(ht_link_t *, void *),
+    void *);
 
 
Index: uspace/lib/c/include/async.h
===================================================================
--- uspace/lib/c/include/async.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/async.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -34,5 +34,5 @@
 
 #if ((defined(LIBC_IPC_H_)) && (!defined(LIBC_ASYNC_C_)))
-	#error Do not intermix low-level IPC interface and async framework
+#error Do not intermix low-level IPC interface and async framework
 #endif
 
Index: uspace/lib/c/include/ctype.h
===================================================================
--- uspace/lib/c/include/ctype.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/ctype.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -61,4 +61,24 @@
 }
 
+static inline int isblank(int c)
+{
+	return c == ' ' || c == '\t';
+}
+
+static inline int iscntrl(int c)
+{
+	return (c >= 0 && c < 0x20) || c == 0x7E;
+}
+
+static inline int isprint(int c)
+{
+	return c >= 0 && c < 0x80 && !iscntrl(c);
+}
+
+static inline int isgraph(int c)
+{
+	return isprint(c) && c != ' ';
+}
+
 static inline int isspace(int c)
 {
@@ -75,4 +95,16 @@
 		return 0;
 	}
+}
+
+static inline int ispunct(int c)
+{
+	return !isspace(c) && !isalnum(c) && isprint(c);
+}
+
+static inline int isxdigit(int c)
+{
+	return isdigit(c) ||
+	    (c >= 'a' && c <= 'f') ||
+	    (c >= 'A' && c <= 'F');
 }
 
Index: uspace/lib/c/include/getopt.h
===================================================================
--- uspace/lib/c/include/getopt.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/getopt.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -57,5 +57,5 @@
 
 /* HelenOS Port - These need to be exposed for legacy getopt() */
-extern const char *optarg;
+extern char *optarg;
 extern int optind, opterr, optopt;
 extern int optreset;
Index: uspace/lib/c/include/gsort.h
===================================================================
--- uspace/lib/c/include/gsort.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/gsort.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -39,5 +39,5 @@
 #include <stdbool.h>
 
-typedef int (* sort_cmp_t)(void *, void *, void *);
+typedef int (*sort_cmp_t)(void *, void *, void *);
 
 extern bool gsort(void *, size_t, size_t, sort_cmp_t, void *);
Index: uspace/lib/c/include/inttypes.h
===================================================================
--- uspace/lib/c/include/inttypes.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/inttypes.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -38,4 +38,11 @@
 #include <_bits/inttypes.h>
 
+#ifndef __HELENOS_DISABLE_INTMAX__
+intmax_t strtoimax(const char *__restrict__ nptr,
+    char **__restrict__ endptr, int base);
+uintmax_t strtoumax(const char *__restrict__ nptr,
+    char **__restrict__ endptr, int base);
+#endif
+
 #endif
 
Index: uspace/lib/c/include/io/kio.h
===================================================================
--- uspace/lib/c/include/io/kio.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/io/kio.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -39,4 +39,6 @@
 #include <stdarg.h>
 #include <io/verify.h>
+#include <_bits/errno.h>
+#include <_bits/size_t.h>
 
 extern errno_t kio_write(const void *, size_t, size_t *);
@@ -44,5 +46,5 @@
 extern void kio_command(const void *, size_t);
 extern int kio_printf(const char *, ...)
-    PRINTF_ATTRIBUTE(1, 2);
+    _HELENOS_PRINTF_ATTRIBUTE(1, 2);
 extern int kio_vprintf(const char *, va_list);
 
Index: uspace/lib/c/include/io/log.h
===================================================================
--- uspace/lib/c/include/io/log.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/io/log.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -60,5 +60,5 @@
 
 extern void log_msg(log_t, log_level_t, const char *, ...)
-    PRINTF_ATTRIBUTE(3, 4);
+    _HELENOS_PRINTF_ATTRIBUTE(3, 4);
 extern void log_msgv(log_t, log_level_t, const char *, va_list);
 
Index: uspace/lib/c/include/io/verify.h
===================================================================
--- uspace/lib/c/include/io/verify.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/io/verify.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -36,19 +36,19 @@
 #define LIBC_IO_VERIFY_H_
 
-#ifndef NVERIFY_PRINTF
+#ifndef _HELENOS_NVERIFY_PRINTF
 
 #ifdef __clang__
-#define PRINTF_ATTRIBUTE(start, end) \
+#define _HELENOS_PRINTF_ATTRIBUTE(start, end) \
 	__attribute__((format(__printf__, start, end)))
 #else
-#define PRINTF_ATTRIBUTE(start, end) \
+#define _HELENOS_PRINTF_ATTRIBUTE(start, end) \
 	__attribute__((format(gnu_printf, start, end)))
 #endif
 
-#else /* NVERIFY_PRINTF */
+#else /* _HELENOS_NVERIFY_PRINTF */
 
-#define PRINTF_ATTRIBUTE(start, end)
+#define _HELENOS_PRINTF_ATTRIBUTE(start, end)
 
-#endif /* NVERIFY_PRINTF */
+#endif /* _HELENOS_NVERIFY_PRINTF */
 
 #endif
Index: uspace/lib/c/include/ipc/devman.h
===================================================================
--- uspace/lib/c/include/ipc/devman.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/ipc/devman.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -74,5 +74,5 @@
 	/** Id of device model.
 	 */
-	const char *id;
+	char *id;
 	/** Relevancy of device-to-driver match.
 	 * The higher is the product of scores specified for the device by the bus driver and by the leaf driver,
Index: uspace/lib/c/include/ipc/ipc.h
===================================================================
--- uspace/lib/c/include/ipc/ipc.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/ipc/ipc.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -34,5 +34,5 @@
 
 #if ((defined(LIBC_ASYNC_H_)) && (!defined(LIBC_ASYNC_C_)))
-	#error Do not intermix low-level IPC interface and async framework
+#error Do not intermix low-level IPC interface and async framework
 #endif
 
Index: uspace/lib/c/include/ipc/logger.h
===================================================================
--- uspace/lib/c/include/ipc/logger.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/ipc/logger.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -54,5 +54,5 @@
 	 * Returns: error code
 	 * Followed by: vfs_pass_handle() request.
-	 */ 
+	 */
 	LOGGER_CONTROL_SET_ROOT
 } logger_control_request_t;
Index: uspace/lib/c/include/malloc.h
===================================================================
--- uspace/lib/c/include/malloc.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/malloc.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -38,13 +38,13 @@
 #include <stddef.h>
 
-extern void *malloc(const size_t size)
+extern void *malloc(size_t size)
     __attribute__((malloc));
-extern void *calloc(const size_t nmemb, const size_t size)
+extern void *calloc(size_t nmemb, size_t size)
     __attribute__((malloc));
-extern void *memalign(const size_t align, const size_t size)
+extern void *memalign(size_t align, size_t size)
     __attribute__((malloc));
-extern void *realloc(const void *addr, const size_t size)
+extern void *realloc(void *addr, size_t size)
     __attribute__((warn_unused_result));
-extern void free(const void *addr);
+extern void free(void *addr);
 extern void *heap_check(void);
 
Index: uspace/lib/c/include/rtld/rtld_debug.h
===================================================================
--- uspace/lib/c/include/rtld/rtld_debug.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/rtld/rtld_debug.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -42,7 +42,7 @@
 
 #ifdef RTLD_DEBUG
-	#define DPRINTF(format, ...) printf(format, ##__VA_ARGS__)
+#define DPRINTF(format, ...) printf(format, ##__VA_ARGS__)
 #else
-	#define DPRINTF(format, ...) if (0) printf(format, ##__VA_ARGS__)
+#define DPRINTF(format, ...) if (0) printf(format, ##__VA_ARGS__)
 #endif
 
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/stdio.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -37,7 +37,7 @@
 
 #include <stdarg.h>
-#include <str.h>
 #include <io/verify.h>
-#include <abi/kio.h>
+#include <_bits/size_t.h>
+#include <_bits/wchar_t.h>
 
 #define EOF  (-1)
@@ -58,11 +58,76 @@
 #define BUFSIZ  4096
 
-#define DEBUG(fmt, ...) \
-	{ \
-		char _buf[256]; \
-		int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \
-		if (_n > 0) \
-			(void) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) _buf, str_size(_buf)); \
-	}
+/** Forward declaration */
+struct _IO_FILE;
+typedef struct _IO_FILE FILE;
+
+extern FILE *stdin;
+extern FILE *stdout;
+extern FILE *stderr;
+
+/* Character and string input functions */
+extern int fgetc(FILE *);
+extern char *fgets(char *, int, FILE *);
+
+extern int getchar(void);
+
+/* Character and string output functions */
+extern int fputc(wchar_t, FILE *);
+extern int fputs(const char *, FILE *);
+
+extern int putchar(wchar_t);
+extern int puts(const char *);
+
+extern int ungetc(int, FILE *);
+
+/* Formatted string output functions */
+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);
+extern int vasprintf(char **, const char *, va_list);
+extern int asprintf(char **, const char *, ...)
+    _HELENOS_PRINTF_ATTRIBUTE(2, 3);
+extern int vsnprintf(char *, size_t, const char *, va_list);
+
+/* File stream functions */
+extern FILE *fopen(const char *, const char *);
+extern FILE *freopen(const char *, const char *, FILE *);
+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 int fseek(FILE *, long, int);
+extern void rewind(FILE *);
+extern long ftell(FILE *);
+extern int feof(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 *);
+
+/* Misc file functions */
+extern int rename(const char *, const char *);
+extern int remove(const char *);
+
+#ifndef _HELENOS_SOURCE
+#define _IONBF 0
+#define _IOLBF 1
+#define _IOFBF 2
+#endif
+
+#ifdef _HELENOS_SOURCE
+
+/* Nonstandard extensions. */
 
 enum _buffer_type {
@@ -86,73 +151,18 @@
 };
 
-/** Forward declaration */
-struct _IO_FILE;
-typedef struct _IO_FILE FILE;
-
-extern FILE *stdin;
-extern FILE *stdout;
-extern FILE *stderr;
-
-/* Character and string input functions */
-extern int fgetc(FILE *);
-extern char *fgets(char *, int, FILE *);
-
-extern int getchar(void);
+extern int vprintf_size(const char *, va_list);
+extern int printf_size(const char *, ...)
+    _HELENOS_PRINTF_ATTRIBUTE(1, 2);
+extern FILE *fdopen(int, const char *);
+extern int fileno(FILE *);
 extern char *gets(char *, size_t);
 
-/* Character and string output functions */
-extern int fputc(wchar_t, FILE *);
-extern int fputs(const char *, FILE *);
+#include <offset.h>
 
-extern int putchar(wchar_t);
-extern int puts(const char *);
+extern int fseek64(FILE *, off64_t, int);
+extern off64_t ftell64(FILE *);
 
-extern int ungetc(int, FILE *);
+#endif
 
-/* Formatted string output functions */
-extern int fprintf(FILE *, const char*, ...)
-    PRINTF_ATTRIBUTE(2, 3);
-extern int vfprintf(FILE *, const char *, va_list);
-
-extern int printf(const char *, ...)
-    PRINTF_ATTRIBUTE(1, 2);
-extern int vprintf(const char *, va_list);
-
-extern int snprintf(char *, size_t , const char *, ...)
-    PRINTF_ATTRIBUTE(3, 4);
-extern int vasprintf(char **, const char *, va_list);
-extern int asprintf(char **, const char *, ...)
-    PRINTF_ATTRIBUTE(2, 3);
-extern int vsnprintf(char *, size_t, const char *, va_list);
-
-extern int printf_size(const char *, ...)
-    PRINTF_ATTRIBUTE(1, 2);
-extern int vprintf_size(const char *, va_list);
-
-/* File stream functions */
-extern FILE *fopen(const char *, const char *);
-extern FILE *fdopen(int, const char *);
-extern FILE *freopen(const char *, const char *, FILE *);
-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 int fseek(FILE *, long, int);
-extern void rewind(FILE *);
-extern long ftell(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 *);
-
-/* Misc file functions */
-extern int rename(const char *, const char *);
-extern int remove(const char *);
 
 #endif
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/stdlib.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -42,12 +42,18 @@
 #define RAND_MAX  714025
 
-#define rand()       random()
-#define srand(seed)  srandom(seed)
-
-extern long int random(void);
-extern void srandom(unsigned int seed);
+extern int rand(void);
+extern void srand(unsigned int seed);
 
 extern void abort(void) __attribute__((noreturn));
 extern void exit(int) __attribute__((noreturn));
+
+extern int atoi(const char *);
+extern long atol(const char *);
+extern long long atoll(const char *);
+
+extern long strtol(const char *__restrict__, char **__restrict__, int);
+extern long long strtoll(const char *__restrict__, char **__restrict__, int);
+extern unsigned long strtoul(const char *__restrict__, char **__restrict__, int);
+extern unsigned long long strtoull(const char *__restrict__, char **__restrict__, int);
 
 #endif
Index: uspace/lib/c/include/syscall.h
===================================================================
--- uspace/lib/c/include/syscall.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/syscall.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -41,5 +41,5 @@
 
 #ifndef LIBARCH_SYSCALL_GENERIC
-	#error You cannot include this file directly
+#error You cannot include this file directly
 #endif
 
Index: uspace/lib/c/include/time.h
===================================================================
--- uspace/lib/c/include/time.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/time.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -31,5 +31,5 @@
  */
 /** @file
- */ 
+ */
 
 #ifndef LIBC_TIME_H_
Index: uspace/lib/c/include/udebug.h
===================================================================
--- uspace/lib/c/include/udebug.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/udebug.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -46,5 +46,5 @@
 extern errno_t udebug_end(async_sess_t *);
 extern errno_t udebug_set_evmask(async_sess_t *, udebug_evmask_t);
-extern errno_t udebug_thread_read(async_sess_t *, void *, size_t , size_t *,
+extern errno_t udebug_thread_read(async_sess_t *, void *, size_t, size_t *,
     size_t *);
 extern errno_t udebug_name_read(async_sess_t *, void *, size_t, size_t *,
Index: uspace/lib/c/include/vfs/inbox.h
===================================================================
--- uspace/lib/c/include/vfs/inbox.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/vfs/inbox.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -29,5 +29,5 @@
 /** @addtogroup libc 
  * @{
- */ 
+ */
 
 /**
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/include/vfs/vfs.h	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -57,5 +57,5 @@
 
 
-struct stat {
+typedef struct {
 	fs_handle_t fs_handle;
 	service_id_t service_id;
@@ -66,12 +66,12 @@
 	aoff64_t size;
 	service_id_t service;
-};
+} vfs_stat_t;
 
-struct statfs { 
+typedef struct {
 	char fs_name[FS_NAME_MAXLEN + 1];
 	uint32_t f_bsize;    /* fundamental file system block size */
 	uint64_t f_blocks;   /* total data blocks in file system */
 	uint64_t f_bfree;    /* free blocks in fs */
-};
+} vfs_statfs_t;
 
 /** List of file system types */
@@ -111,8 +111,8 @@
 extern int vfs_root(void);
 extern errno_t vfs_root_set(int);
-extern errno_t vfs_stat(int, struct stat *);
-extern errno_t vfs_stat_path(const char *, struct stat *);
-extern errno_t vfs_statfs(int, struct statfs *);
-extern errno_t vfs_statfs_path(const char *, struct statfs *);
+extern errno_t vfs_stat(int, vfs_stat_t *);
+extern errno_t vfs_stat_path(const char *, vfs_stat_t *);
+extern errno_t vfs_statfs(int, vfs_statfs_t *);
+extern errno_t vfs_statfs_path(const char *, vfs_statfs_t *);
 extern errno_t vfs_sync(int);
 extern errno_t vfs_unlink(int, const char *, int);
Index: uspace/lib/c/test/sprintf.c
===================================================================
--- uspace/lib/c/test/sprintf.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/lib/c/test/sprintf.c	(revision 4e17d54b4419e0e016292f66bc09bd15538510a1)
@@ -28,4 +28,5 @@
 
 #include <stdio.h>
+#include <str.h>
 #include <pcut/pcut.h>
 
