Index: uspace/app/bdsh/cmds/builtins/batch/batch.c
===================================================================
--- uspace/app/bdsh/cmds/builtins/batch/batch.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/builtins/batch/batch.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -32,4 +32,5 @@
 #include <stddef.h>
 #include <errno.h>
+#include <str.h>
 #include "config.h"
 #include "util.h"
Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -215,5 +215,5 @@
 
 	if (tail != CAT_FULL_FILE) {
-		struct stat st;
+		vfs_stat_t st;
 
 		if (vfs_stat(fd, &st) != EOK) {
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -80,5 +80,5 @@
 static dentry_type_t get_type(const char *path)
 {
-	struct stat s;
+	vfs_stat_t s;
 
 	errno_t r = vfs_stat_path(path, &s);
@@ -340,6 +340,6 @@
 		 */
 		while ((dp = readdir(dir))) {
-			struct stat src_s;
-			struct stat dest_s;
+			vfs_stat_t src_s;
+			vfs_stat_t dest_s;
 
 			char src_dent[PATH_MAX];
@@ -392,5 +392,5 @@
 	char *buff = NULL;
 	aoff64_t posr = 0, posw = 0;
-	struct stat st;
+	vfs_stat_t st;
 
 	if (vb)
Index: uspace/app/bdsh/cmds/modules/ls/ls.h
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/modules/ls/ls.h	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -23,5 +23,5 @@
 struct dir_elem_t {
 	char *name;
-	struct stat s;
+	vfs_stat_t s;
 };
 
Index: uspace/app/bdsh/cmds/modules/mount/mount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/modules/mount/mount.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -37,4 +37,5 @@
 #include <getopt.h>
 #include <inttypes.h>
+#include <str.h>
 #include "config.h"
 #include "util.h"
Index: uspace/app/bdsh/cmds/modules/sleep/sleep.c
===================================================================
--- uspace/app/bdsh/cmds/modules/sleep/sleep.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/modules/sleep/sleep.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -31,4 +31,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 #include "config.h"
 #include "util.h"
Index: uspace/app/bdsh/cmds/modules/touch/touch.c
===================================================================
--- uspace/app/bdsh/cmds/modules/touch/touch.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/cmds/modules/touch/touch.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -82,5 +82,5 @@
 	int longind;
 	bool no_create = false;
-	struct stat file_stat;
+	vfs_stat_t file_stat;
 	int fd = -1;
 	char *buff = NULL;
Index: uspace/app/bdsh/compl.c
===================================================================
--- uspace/app/bdsh/compl.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/compl.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -34,4 +34,5 @@
 #include <stdlib.h>
 #include <vfs/vfs.h>
+#include <str.h>
 
 #include "cmds/cmds.h"
@@ -68,7 +69,7 @@
 
 	/** Pointer inside list of directories */
-	const char **path;
+	const char *const *path;
 	/** If not @c NULL, should be freed in the end. */
-	const char **path_list;
+	char **path_list;
 	/** Current open directory */
 	DIR *dir;
@@ -218,5 +219,7 @@
 		cs->path_list[0] = dirname;
 		cs->path_list[1] = NULL;
-		cs->path = cs->path_list;
+		/* The second const ensures that we can't assign a const
+		 * string to the non-const array. */
+		cs->path = (const char *const *) cs->path_list;
 
 	} else if (cs->is_command) {
@@ -359,5 +362,5 @@
 				char *ent_path;
 				asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name);
-				struct stat ent_stat;
+				vfs_stat_t ent_stat;
 				if (vfs_stat_path(ent_path, &ent_stat) != EOK) {
 					/* Error */
Index: uspace/app/bdsh/errors.h
===================================================================
--- uspace/app/bdsh/errors.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/errors.h	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -49,5 +49,5 @@
 
 extern void cli_error(int, const char *, ...)
-    PRINTF_ATTRIBUTE(2, 3);
+    _HELENOS_PRINTF_ATTRIBUTE(2, 3);
 
 #endif
Index: uspace/app/bdsh/tok.h
===================================================================
--- uspace/app/bdsh/tok.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bdsh/tok.h	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -42,5 +42,5 @@
 	size_t byte_length;
 	size_t char_length;
- 	token_type_t type;
+	token_type_t type;
 } token_t;
 
Index: uspace/app/blkdump/blkdump.c
===================================================================
--- uspace/app/blkdump/blkdump.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/blkdump/blkdump.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -49,4 +49,5 @@
 #include <inttypes.h>
 #include <errno.h>
+#include <str.h>
 
 #define NAME	"blkdump"
Index: uspace/app/bnchmark/bnchmark.c
===================================================================
--- uspace/app/bnchmark/bnchmark.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/bnchmark/bnchmark.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -49,4 +49,5 @@
 #include <time.h>
 #include <dirent.h>
+#include <str.h>
 
 #define NAME	"bnchmark"
Index: uspace/app/corecfg/corecfg.c
===================================================================
--- uspace/app/corecfg/corecfg.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/corecfg/corecfg.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -36,4 +36,5 @@
 #include <errno.h>
 #include <stdio.h>
+#include <str.h>
 
 #define NAME "corecfg"
Index: uspace/app/date/date.c
===================================================================
--- uspace/app/date/date.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/date/date.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -36,4 +36,5 @@
 #include <getopt.h>
 #include <ctype.h>
+#include <str.h>
 
 #define NAME   "date"
Index: uspace/app/devctl/devctl.c
===================================================================
--- uspace/app/devctl/devctl.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/devctl/devctl.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -39,4 +39,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 #include <str_error.h>
 
Index: uspace/app/df/df.c
===================================================================
--- uspace/app/df/df.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/df/df.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -58,5 +58,5 @@
 static errno_t size_to_human_readable(uint64_t, size_t, char **);
 static void print_header(void);
-static errno_t print_statfs(struct statfs *, char *, char *);
+static errno_t print_statfs(vfs_statfs_t *, char *, char *);
 static void print_usage(void);
 
@@ -64,5 +64,5 @@
 {
 	int optres, errflg = 0;
-	struct statfs st;
+	vfs_statfs_t st;
 	errno_t rc;
 
@@ -147,5 +147,5 @@
 }
 
-static errno_t print_statfs(struct statfs *st, char *name, char *mountpoint)
+static errno_t print_statfs(vfs_statfs_t *st, char *name, char *mountpoint)
 {
 	uint64_t const used_blocks = st->f_blocks - st->f_bfree;
Index: uspace/app/dltest/dltest.c
===================================================================
--- uspace/app/dltest/dltest.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/dltest/dltest.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -41,4 +41,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 
 /** libdltest library handle */
Index: uspace/app/dnscfg/dnscfg.c
===================================================================
--- uspace/app/dnscfg/dnscfg.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/dnscfg/dnscfg.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -43,4 +43,5 @@
 #include <stdlib.h>
 #include <stdint.h>
+#include <str.h>
 #include <str_error.h>
 
Index: uspace/app/dnsres/dnsres.c
===================================================================
--- uspace/app/dnsres/dnsres.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/dnsres/dnsres.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -38,4 +38,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 
 #define NAME  "dnsres"
Index: uspace/app/edit/search_impl.h
===================================================================
--- uspace/app/edit/search_impl.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/edit/search_impl.h	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -43,5 +43,5 @@
 	/* Note: This structure is opaque for the user. */
 
-	const wchar_t *pattern;
+	wchar_t *pattern;
 	size_t pattern_length;
 	ssize_t *back_table;
Index: uspace/app/fdisk/fdisk.c
===================================================================
--- uspace/app/fdisk/fdisk.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/fdisk/fdisk.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -42,4 +42,5 @@
 #include <stdlib.h>
 #include <fdisk.h>
+#include <str.h>
 
 #define NO_LABEL_CAPTION "(No name)"
Index: uspace/app/fontviewer/fontviewer.c
===================================================================
--- uspace/app/fontviewer/fontviewer.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/fontviewer/fontviewer.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -139,5 +139,5 @@
 
 static int text(drawctx_t *, font_t *, source_t *, surface_coord_t x,
-    surface_coord_t , const char *, ...) PRINTF_ATTRIBUTE(6, 7);
+    surface_coord_t , const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(6, 7);
 static int text(drawctx_t *drawctx, font_t *font, source_t *source,
     surface_coord_t x, surface_coord_t y, const char *fmt, ...)
Index: uspace/app/getterm/getterm.c
===================================================================
--- uspace/app/getterm/getterm.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/getterm/getterm.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -42,4 +42,5 @@
 #include <loc.h>
 #include <vfs/vfs.h>
+#include <str.h>
 #include "version.h"
 #include "welcome.h"
Index: uspace/app/inet/inet.c
===================================================================
--- uspace/app/inet/inet.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/inet/inet.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -43,4 +43,5 @@
 #include <stdlib.h>
 #include <stdint.h>
+#include <str.h>
 #include <str_error.h>
 
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/init/init.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -152,5 +152,5 @@
 static errno_t srv_startl(const char *path, ...)
 {
-	struct stat s;
+	vfs_stat_t s;
 	if (vfs_stat_path(path, &s) != EOK) {
 		printf("%s: Unable to stat %s\n", NAME, path);
Index: uspace/app/kill/kill.c
===================================================================
--- uspace/app/kill/kill.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/kill/kill.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -37,4 +37,5 @@
 #include <stdio.h>
 #include <task.h>
+#include <str.h>
 #include <str_error.h>
 
Index: uspace/app/killall/killall.c
===================================================================
--- uspace/app/killall/killall.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/killall/killall.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -40,4 +40,5 @@
 #include <str_error.h>
 #include <stdlib.h>
+#include <str.h>
 
 #define NAME  "killall"
Index: uspace/app/mixerctl/mixerctl.c
===================================================================
--- uspace/app/mixerctl/mixerctl.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/mixerctl/mixerctl.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -49,5 +49,5 @@
 static void print_levels(async_exch_t *exch)
 {
-	const char* name = NULL;
+	char* name = NULL;
 	unsigned count = 0;
 	errno_t ret = audio_mixer_get_info(exch, &name, &count);
@@ -59,5 +59,5 @@
 
 	for (unsigned i = 0; i < count; ++i) {
-		const char *name = NULL;
+		char *name = NULL;
 		unsigned levels = 0, current = 0;
 		errno_t ret =
Index: uspace/app/mkfat/mkfat.c
===================================================================
--- uspace/app/mkfat/mkfat.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/mkfat/mkfat.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -48,4 +48,5 @@
 #include <inttypes.h>
 #include <errno.h>
+#include <str.h>
 #include "fat.h"
 #include "fat_dentry.h"
Index: uspace/app/netecho/comm.c
===================================================================
--- uspace/app/netecho/comm.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/netecho/comm.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -44,4 +44,5 @@
 #include <stdlib.h>
 #include <stdint.h>
+#include <str.h>
 #include <str_error.h>
 
Index: uspace/app/netstart/self_test.c
===================================================================
--- uspace/app/netstart/self_test.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ 	(revision )
@@ -1,334 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * 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 net
- * @{
- */
-
-/** @file
- * Networking self-tests implementation.
- *
- */
-
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <net_checksum.h>
-#include <adt/int_map.h>
-#include <adt/char_map.h>
-#include <adt/generic_char_map.h>
-#include <adt/measured_strings.h>
-#include <adt/dynamic_fifo.h>
-
-#include "self_test.h"
-
-/** Test the statement, compare the result and evaluate.
- *
- * @param[in] statement The statement to test.
- * @param[in] result    The expected result.
- *
- */
-#define TEST(statement, result) \
-	do { \
-		printf("\n\t%s == %s", #statement, #result); \
-		if ((statement) != (result)) { \
-			printf("\tfailed\n"); \
-			fprintf(stderr, "\nNetwork self-test failed\n"); \
-			return EINVAL; \
-		} else \
-			printf("\tOK"); \
-	} while (0)
-
-#define XMALLOC(var, type) \
-	do { \
-		(var) = (type *) malloc(sizeof(type)); \
-		if ((var) == NULL) { \
-			fprintf(stderr, "\nMemory allocation error\n"); \
-			return ENOMEM; \
-		} \
-	} while (0)
-
-GENERIC_CHAR_MAP_DECLARE(int_char_map, int);
-GENERIC_CHAR_MAP_IMPLEMENT(int_char_map, int);
-
-GENERIC_FIELD_DECLARE(int_field, int);
-GENERIC_FIELD_IMPLEMENT(int_field, int);
-
-INT_MAP_DECLARE(int_map, int);
-INT_MAP_IMPLEMENT(int_map, int);
-
-/** Self-test start function.
- *
- * Run all self-tests.
- *
- * @returns EOK on success.
- * @returns The first error occurred.
- *
- */
-errno_t self_test(void)
-{
-	printf("Running networking self-tests\n");
-	
-	printf("\nChar map test");
-	char_map_t cm;
-	
-	TEST(char_map_update(&cm, "ucho", 0, 3), EINVAL);
-	TEST(char_map_initialize(&cm), EOK);
-	TEST(char_map_exclude(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_find(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_add(&cm, "bla", 0, 1), EOK);
-	TEST(char_map_find(&cm, "bla", 0), 1);
-	TEST(char_map_add(&cm, "bla", 0, 10), EEXISTS);
-	TEST(char_map_update(&cm, "bla", 0, 2), EOK);
-	TEST(char_map_find(&cm, "bla", 0), 2);
-	TEST(char_map_update(&cm, "ucho", 0, 2), EOK);
-	TEST(char_map_exclude(&cm, "bla", 0), 2);
-	TEST(char_map_exclude(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_find(&cm, "ucho", 0), 2);
-	TEST(char_map_update(&cm, "ucho", 0, 3), EOK);
-	TEST(char_map_find(&cm, "ucho", 0), 3);
-	TEST(char_map_add(&cm, "blabla", 0, 5), EOK);
-	TEST(char_map_find(&cm, "blabla", 0), 5);
-	TEST(char_map_add(&cm, "bla", 0, 6), EOK);
-	TEST(char_map_find(&cm, "bla", 0), 6);
-	TEST(char_map_exclude(&cm, "bla", 0), 6);
-	TEST(char_map_find(&cm, "bla", 0), CHAR_MAP_NULL);
-	TEST(char_map_find(&cm, "blabla", 0), 5);
-	TEST(char_map_add(&cm, "auto", 0, 7), EOK);
-	TEST(char_map_find(&cm, "auto", 0), 7);
-	TEST(char_map_add(&cm, "kara", 0, 8), EOK);
-	TEST(char_map_find(&cm, "kara", 0), 8);
-	TEST(char_map_add(&cm, "nic", 0, 9), EOK);
-	TEST(char_map_find(&cm, "nic", 0), 9);
-	TEST(char_map_find(&cm, "blabla", 0), 5);
-	TEST(char_map_add(&cm, "micnicnic", 5, 9), EOK);
-	TEST(char_map_find(&cm, "micni", 0), 9);
-	TEST(char_map_find(&cm, "micnicn", 5), 9);
-	TEST(char_map_add(&cm, "\x10\x0\x2\x2", 4, 15), EOK);
-	TEST(char_map_find(&cm, "\x10\x0\x2\x2", 4), 15);
-	
-	TEST((char_map_destroy(&cm), EOK), EOK);
-	TEST(char_map_update(&cm, "ucho", 0, 3), EINVAL);
-	
-	printf("\nCRC computation test");
-	uint32_t value;
-	
-	TEST(value = ~compute_crc32(~0, "123456789", 8 * 9), 0xcbf43926);
-	TEST(value = ~compute_crc32(~0, "1", 8), 0x83dcefb7);
-	TEST(value = ~compute_crc32(~0, "12", 8 * 2), 0x4f5344cd);
-	TEST(value = ~compute_crc32(~0, "123", 8 * 3), 0x884863d2);
-	TEST(value = ~compute_crc32(~0, "1234", 8 * 4), 0x9be3e0a3);
-	TEST(value = ~compute_crc32(~0, "12345678", 8 * 8), 0x9ae0daaf);
-	TEST(value = ~compute_crc32(~0, "ahoj pane", 8 * 9), 0x5fc3d706);
-	
-	printf("\nDynamic fifo test");
-	dyn_fifo_t fifo;
-	
-	TEST(dyn_fifo_push(&fifo, 1, 0), EINVAL);
-	TEST(dyn_fifo_initialize(&fifo, 1), EOK);
-	TEST(dyn_fifo_push(&fifo, 1, 0), EOK);
-	TEST(dyn_fifo_pop(&fifo), 1);
-	TEST(dyn_fifo_pop(&fifo), ENOENT);
-	TEST(dyn_fifo_push(&fifo, 2, 1), EOK);
-	TEST(dyn_fifo_push(&fifo, 3, 1), ENOMEM);
-	TEST(dyn_fifo_push(&fifo, 3, 0), EOK);
-	TEST(dyn_fifo_pop(&fifo), 2);
-	TEST(dyn_fifo_pop(&fifo), 3);
-	TEST(dyn_fifo_push(&fifo, 4, 2), EOK);
-	TEST(dyn_fifo_push(&fifo, 5, 2), EOK);
-	TEST(dyn_fifo_push(&fifo, 6, 2), ENOMEM);
-	TEST(dyn_fifo_push(&fifo, 6, 5), EOK);
-	TEST(dyn_fifo_push(&fifo, 7, 5), EOK);
-	TEST(dyn_fifo_pop(&fifo), 4);
-	TEST(dyn_fifo_pop(&fifo), 5);
-	TEST(dyn_fifo_push(&fifo, 8, 5), EOK);
-	TEST(dyn_fifo_push(&fifo, 9, 5), EOK);
-	TEST(dyn_fifo_push(&fifo, 10, 6), EOK);
-	TEST(dyn_fifo_push(&fifo, 11, 6), EOK);
-	TEST(dyn_fifo_pop(&fifo), 6);
-	TEST(dyn_fifo_pop(&fifo), 7);
-	TEST(dyn_fifo_push(&fifo, 12, 6), EOK);
-	TEST(dyn_fifo_push(&fifo, 13, 6), EOK);
-	TEST(dyn_fifo_push(&fifo, 14, 6), ENOMEM);
-	TEST(dyn_fifo_push(&fifo, 14, 8), EOK);
-	TEST(dyn_fifo_pop(&fifo), 8);
-	TEST(dyn_fifo_pop(&fifo), 9);
-	TEST(dyn_fifo_pop(&fifo), 10);
-	TEST(dyn_fifo_pop(&fifo), 11);
-	TEST(dyn_fifo_pop(&fifo), 12);
-	TEST(dyn_fifo_pop(&fifo), 13);
-	TEST(dyn_fifo_pop(&fifo), 14);
-	TEST(dyn_fifo_destroy(&fifo), EOK);
-	TEST(dyn_fifo_push(&fifo, 1, 0), EINVAL);
-	
-	printf("\nGeneric char map test");
-	
-	int *x;
-	int *y;
-	int *z;
-	int *u;
-	int *v;
-	int *w;
-	
-	XMALLOC(x, int);
-	XMALLOC(y, int);
-	XMALLOC(z, int);
-	XMALLOC(u, int);
-	XMALLOC(v, int);
-	XMALLOC(w, int);
-	
-	int_char_map_t icm;
-	icm.magic = 0;
-	
-	TEST(int_char_map_add(&icm, "ucho", 0, z), EINVAL);
-	TEST(int_char_map_initialize(&icm), EOK);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), NULL);
-	TEST(int_char_map_add(&icm, "bla", 0, x), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), x);
-	TEST(int_char_map_add(&icm, "bla", 0, y), EEXISTS);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST(int_char_map_add(&icm, "blabla", 0, v), EOK);
-	TEST(int_char_map_find(&icm, "blabla", 0), v);
-	TEST(int_char_map_add(&icm, "bla", 0, w), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), w);
-	TEST((int_char_map_exclude(&icm, "bla", 0), EOK), EOK);
-	TEST(int_char_map_find(&icm, "bla", 0), NULL);
-	TEST(int_char_map_find(&icm, "blabla", 0), v);
-	TEST(int_char_map_add(&icm, "auto", 0, u), EOK);
-	TEST(int_char_map_find(&icm, "auto", 0), u);
-	TEST((int_char_map_destroy(&icm), EOK), EOK);
-	TEST(int_char_map_add(&icm, "ucho", 0, z), EINVAL);
-	
-	printf("\nGeneric field test");
-	
-	XMALLOC(x, int);
-	XMALLOC(y, int);
-	XMALLOC(z, int);
-	XMALLOC(u, int);
-	XMALLOC(v, int);
-	XMALLOC(w, int);
-	
-	int_field_t gf;
-	gf.magic = 0;
-	
-	TEST(int_field_add(&gf, x), EINVAL);
-	TEST(int_field_count(&gf), -1);
-	TEST(int_field_initialize(&gf), EOK);
-	TEST(int_field_count(&gf), 0);
-	TEST(int_field_get_index(&gf, 1), NULL);
-	TEST(int_field_add(&gf, x), 0);
-	TEST(int_field_get_index(&gf, 0), x);
-	TEST((int_field_exclude_index(&gf, 0), EOK), EOK);
-	TEST(int_field_get_index(&gf, 0), NULL);
-	TEST(int_field_add(&gf, y), 1);
-	TEST(int_field_get_index(&gf, 1), y);
-	TEST(int_field_add(&gf, z), 2);
-	TEST(int_field_get_index(&gf, 2), z);
-	TEST(int_field_get_index(&gf, 1), y);
-	TEST(int_field_count(&gf), 3);
-	TEST(int_field_add(&gf, u), 3);
-	TEST(int_field_get_index(&gf, 3), u);
-	TEST(int_field_add(&gf, v), 4);
-	TEST(int_field_get_index(&gf, 4), v);
-	TEST(int_field_add(&gf, w), 5);
-	TEST(int_field_get_index(&gf, 5), w);
-	TEST(int_field_count(&gf), 6);
-	TEST((int_field_exclude_index(&gf, 1), EOK), EOK);
-	TEST(int_field_get_index(&gf, 1), NULL);
-	TEST(int_field_get_index(&gf, 3), u);
-	TEST((int_field_exclude_index(&gf, 7), EOK), EOK);
-	TEST(int_field_get_index(&gf, 3), u);
-	TEST(int_field_get_index(&gf, 5), w);
-	TEST((int_field_exclude_index(&gf, 4), EOK), EOK);
-	TEST(int_field_get_index(&gf, 4), NULL);
-	TEST((int_field_destroy(&gf), EOK), EOK);
-	TEST(int_field_count(&gf), -1);
-	
-	printf("\nInt map test");
-	
-	XMALLOC(x, int);
-	XMALLOC(y, int);
-	XMALLOC(z, int);
-	XMALLOC(u, int);
-	XMALLOC(v, int);
-	XMALLOC(w, int);
-	
-	int_map_t im;
-	im.magic = 0;
-	
-	TEST(int_map_add(&im, 1, x), EINVAL);
-	TEST(int_map_count(&im), -1);
-	TEST(int_map_initialize(&im), EOK);
-	TEST(int_map_count(&im), 0);
-	TEST(int_map_find(&im, 1), NULL);
-	TEST(int_map_add(&im, 1, x), 0);
-	TEST(int_map_find(&im, 1), x);
-	TEST((int_map_exclude(&im, 1), EOK), EOK);
-	TEST(int_map_find(&im, 1), NULL);
-	TEST(int_map_add(&im, 1, y), 1);
-	TEST(int_map_find(&im, 1), y);
-	TEST(int_map_add(&im, 4, z), 2);
-	TEST(int_map_get_index(&im, 2), z);
-	TEST(int_map_find(&im, 4), z);
-	TEST(int_map_find(&im, 1), y);
-	TEST(int_map_count(&im), 3);
-	TEST(int_map_add(&im, 2, u), 3);
-	TEST(int_map_find(&im, 2), u);
-	TEST(int_map_add(&im, 3, v), 4);
-	TEST(int_map_find(&im, 3), v);
-	TEST(int_map_get_index(&im, 4), v);
-	TEST(int_map_add(&im, 6, w), 5);
-	TEST(int_map_find(&im, 6), w);
-	TEST(int_map_count(&im), 6);
-	TEST((int_map_exclude(&im, 1), EOK), EOK);
-	TEST(int_map_find(&im, 1), NULL);
-	TEST(int_map_find(&im, 2), u);
-	TEST((int_map_exclude(&im, 7), EOK), EOK);
-	TEST(int_map_find(&im, 2), u);
-	TEST(int_map_find(&im, 6), w);
-	TEST((int_map_exclude_index(&im, 4), EOK), EOK);
-	TEST(int_map_get_index(&im, 4), NULL);
-	TEST(int_map_find(&im, 3), NULL);
-	TEST((int_map_destroy(&im), EOK), EOK);
-	TEST(int_map_count(&im), -1);
-	
-	printf("\nMeasured strings test");
-	
-	measured_string_ref string =
-	    measured_string_create_bulk("I am a measured string!", 0);
-	printf("\n%x, %s at %x of %d\n", string, string->value, string->value,
-	    string->length);
-	
-	return EOK;
-}
-
-/** @}
- */
Index: uspace/app/netstart/self_test.h
===================================================================
--- uspace/app/netstart/self_test.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
- * Copyright (c) 2009 Lukas Mejdrech
- * 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 net
- * @{
- */
-
-#ifndef __SELF_TEST_H__
-#define __SELF_TEST_H__
-
-extern errno_t self_test(void);
-
-#endif
-
-/** @}
- */
Index: uspace/app/nic/nic.c
===================================================================
--- uspace/app/nic/nic.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/nic/nic.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -40,4 +40,5 @@
 #include <stdlib.h>
 #include <stddef.h>
+#include <str.h>
 #include <str_error.h>
 
Index: uspace/app/nterm/nterm.c
===================================================================
--- uspace/app/nterm/nterm.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/nterm/nterm.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -37,4 +37,5 @@
 #include <io/console.h>
 #include <stdio.h>
+#include <str.h>
 
 #include "conn.h"
Index: uspace/app/pkg/pkg.c
===================================================================
--- uspace/app/pkg/pkg.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/pkg/pkg.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -39,4 +39,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 #include <str_error.h>
 #include <task.h>
Index: uspace/app/rcubench/rcubench.c
===================================================================
--- uspace/app/rcubench/rcubench.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/rcubench/rcubench.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -47,4 +47,5 @@
 #include <compiler/barrier.h>
 #include <futex.h>
+#include <str.h>
 
 #include <rcu.h>
Index: uspace/app/rcutest/rcutest.c
===================================================================
--- uspace/app/rcutest/rcutest.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/rcutest/rcutest.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -48,4 +48,5 @@
 #include <compiler/barrier.h>
 #include <futex.h>
+#include <str.h>
 
 #include <rcu.h>
Index: uspace/app/sportdmp/sportdmp.c
===================================================================
--- uspace/app/sportdmp/sportdmp.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/sportdmp/sportdmp.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -33,4 +33,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 
 #define BUF_SIZE 1
Index: uspace/app/sysinfo/sysinfo.c
===================================================================
--- uspace/app/sysinfo/sysinfo.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/sysinfo/sysinfo.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -40,4 +40,5 @@
 #include <sysinfo.h>
 #include <stdlib.h>
+#include <str.h>
 
 static void dump_bytes_hex(char *data, size_t size)
Index: uspace/app/sysinst/futil.c
===================================================================
--- uspace/app/sysinst/futil.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/sysinst/futil.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -108,5 +108,5 @@
 	DIR *dir;
 	struct dirent *de;
-	struct stat s;
+	vfs_stat_t s;
 	char *srcp, *destp;
 	errno_t rc;
@@ -165,5 +165,5 @@
 	size_t fsize;
 	char *data;
-	struct stat st;
+	vfs_stat_t st;
 
 	rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf);
Index: uspace/app/sysinst/sysinst.c
===================================================================
--- uspace/app/sysinst/sysinst.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/sysinst/sysinst.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -47,4 +47,5 @@
 #include <task.h>
 #include <vfs/vfs.h>
+#include <str.h>
 
 #include "futil.h"
Index: uspace/app/taskdump/elf_core.c
===================================================================
--- uspace/app/taskdump/elf_core.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/taskdump/elf_core.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -62,4 +62,5 @@
 #include <libarch/istate.h>
 #include <vfs/vfs.h>
+#include <str.h>
 
 #include "elf_core.h"
Index: uspace/app/taskdump/symtab.c
===================================================================
--- uspace/app/taskdump/symtab.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/taskdump/symtab.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -41,4 +41,5 @@
 #include <stddef.h>
 #include <errno.h>
+#include <str.h>
 #include <str_error.h>
 #include <vfs/vfs.h>
Index: uspace/app/taskdump/taskdump.c
===================================================================
--- uspace/app/taskdump/taskdump.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/taskdump/taskdump.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -48,4 +48,5 @@
 #include <macros.h>
 #include <assert.h>
+#include <str.h>
 
 #include <symtab.h>
Index: uspace/app/tester/print/print5.c
===================================================================
--- uspace/app/tester/print/print5.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/tester/print/print5.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -37,5 +37,5 @@
  *
  */
-#define NVERIFY_PRINTF
+#define _HELENOS_NVERIFY_PRINTF
 
 #include <stdio.h>
Index: uspace/app/testread/testread.c
===================================================================
--- uspace/app/testread/testread.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/testread/testread.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -58,4 +58,5 @@
 #include <time.h>
 #include <offset.h>
+#include <str.h>
 
 #define NAME	"testread"
Index: uspace/app/testwrit/testwrit.c
===================================================================
--- uspace/app/testwrit/testwrit.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/testwrit/testwrit.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -33,4 +33,5 @@
 #include <stdio.h>
 #include <stddef.h>
+#include <str.h>
 
 #define BUF_SIZE  1024
Index: uspace/app/tetris/tetris.c
===================================================================
--- uspace/app/tetris/tetris.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/tetris/tetris.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -156,7 +156,7 @@
 const struct shape *randshape(void)
 {
-	const struct shape *tmp = &shapes[random() % 7];
+	const struct shape *tmp = &shapes[rand() % 7];
 	int i;
-	int j = random() % 4;
+	int j = rand() % 4;
 	
 	for (i = 0; i < j; i++)
@@ -171,5 +171,5 @@
 	
 	gettimeofday(&tv, NULL);
-	srandom(tv.tv_sec + tv.tv_usec / 100000);
+	srand(tv.tv_sec + tv.tv_usec / 100000);
 }
 
Index: uspace/app/tmon/burst_tests.c
===================================================================
--- uspace/app/tmon/burst_tests.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/tmon/burst_tests.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -37,4 +37,5 @@
 #include <stdio.h>
 #include <errno.h>
+#include <str.h>
 #include <str_error.h>
 #include <getopt.h>
Index: uspace/app/tmon/main.c
===================================================================
--- uspace/app/tmon/main.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/tmon/main.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -36,4 +36,6 @@
 
 #include <stdio.h>
+#include <stddef.h>
+#include <str.h>
 #include <macros.h>
 #include "commands.h"
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/top/screen.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -45,4 +45,5 @@
 #include <inttypes.h>
 #include <macros.h>
+#include <str.h>
 #include "screen.h"
 #include "top.h"
Index: uspace/app/top/screen.h
===================================================================
--- uspace/app/top/screen.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/top/screen.h	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -45,5 +45,5 @@
 extern void print_data(data_t *);
 extern void show_warning(const char *, ...)
-    PRINTF_ATTRIBUTE(1, 2);
+    _HELENOS_PRINTF_ATTRIBUTE(1, 2);
 
 extern int tgetchar(unsigned int);
Index: uspace/app/top/top.c
===================================================================
--- uspace/app/top/top.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/top/top.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -43,4 +43,5 @@
 #include <errno.h>
 #include <gsort.h>
+#include <str.h>
 #include "screen.h"
 #include "top.h"
Index: uspace/app/usbinfo/list.c
===================================================================
--- uspace/app/usbinfo/list.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/usbinfo/list.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -45,4 +45,5 @@
 #include <loc.h>
 #include <usb_iface.h>
+#include <str.h>
 
 #include "usbinfo.h"
Index: uspace/app/viewer/viewer.c
===================================================================
--- uspace/app/viewer/viewer.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/viewer/viewer.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -44,4 +44,5 @@
 #include <codec/tga.h>
 #include <task.h>
+#include <str.h>
 
 #define NAME  "viewer"
@@ -114,5 +115,5 @@
 		return false;
 	
-	struct stat stat;
+	vfs_stat_t stat;
 	rc = vfs_stat(fd, &stat);
 	if (rc != EOK) {
Index: uspace/app/wavplay/dplay.c
===================================================================
--- uspace/app/wavplay/dplay.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/wavplay/dplay.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -353,5 +353,5 @@
 	}
 
-	const char* info = NULL;
+	char* info = NULL;
 	ret = audio_pcm_get_info_str(session, &info);
 	if (ret != EOK) {
Index: uspace/app/wavplay/drec.c
===================================================================
--- uspace/app/wavplay/drec.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/wavplay/drec.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -42,4 +42,5 @@
 #include <as.h>
 #include <inttypes.h>
+#include <str.h>
 
 #include "wave.h"
@@ -194,5 +195,5 @@
 	}
 
-	const char* info = NULL;
+	char* info = NULL;
 	ret = audio_pcm_get_info_str(session, &info);
 	if (ret != EOK) {
Index: uspace/app/wifi_supplicant/wifi_supplicant.c
===================================================================
--- uspace/app/wifi_supplicant/wifi_supplicant.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
+++ uspace/app/wifi_supplicant/wifi_supplicant.c	(revision da9d6cae9d1c35542e015f3d2826946a83fef587)
@@ -41,4 +41,5 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <str.h>
 #include <str_error.h>
 #include <loc.h>
