Index: HelenOS.config
===================================================================
--- HelenOS.config	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ HelenOS.config	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -594,4 +594,5 @@
 @ "16"
 @ "24"
+@ "32"
 ! [(PLATFORM=ia32|PLATFORM=amd64|MACHINE=beagleboardxm)&CONFIG_HID_OUT!=none&CONFIG_FB=y] CONFIG_BFB_BPP (choice)
 
Index: abi/include/abi/errno.h
===================================================================
--- abi/include/abi/errno.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ abi/include/abi/errno.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -62,5 +62,5 @@
 #define EPARTY         -8
 
-#define EEXISTS        -9   /* Entry already exists */
+#define EEXIST         -9   /* Entry already exists */
 #define EBADMEM        -10  /* Bad memory pointer */
 #define ENOTSUP        -11  /* Not supported */
Index: kernel/generic/src/console/console.c
===================================================================
--- kernel/generic/src/console/console.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ kernel/generic/src/console/console.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -437,5 +437,5 @@
 	}
 
-	return size;
+	return EOK;
 }
 
Index: kernel/generic/src/ipc/event.c
===================================================================
--- kernel/generic/src/ipc/event.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ kernel/generic/src/ipc/event.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -251,5 +251,5 @@
  *
  * @return EOK if the subscription was successful.
- * @return EEXISTS if the notifications of the given type are
+ * @return EEXIST if the notifications of the given type are
  *         already subscribed.
  *
@@ -269,5 +269,5 @@
 		res = EOK;
 	} else
-		res = EEXISTS;
+		res = EEXIST;
 	
 	spinlock_unlock(&event->lock);
@@ -282,5 +282,5 @@
  *
  * @return EOK if the subscription was successful.
- * @return EEXISTS if the notifications of the given type are
+ * @return EEXIST if the notifications of the given type are
  *         already subscribed.
  *
@@ -334,5 +334,5 @@
  * @return EOK on success.
  * @return ELIMIT on unknown event type.
- * @return EEXISTS if the notifications of the given type are
+ * @return EEXIST if the notifications of the given type are
  *         already subscribed.
  *
Index: kernel/generic/src/ipc/irq.c
===================================================================
--- kernel/generic/src/ipc/irq.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ kernel/generic/src/ipc/irq.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -351,5 +351,5 @@
 		
 		free(irq);
-		return EEXISTS;
+		return EEXIST;
 	}
 	
Index: tools/xcw/bin/helenos-cc
===================================================================
--- tools/xcw/bin/helenos-cc	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ tools/xcw/bin/helenos-cc	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -46,5 +46,6 @@
     -fno-omit-frame-pointer \
     -D "$ENDIAN" \
+    "$@" \
     -I"$SRC_ROOT"/uspace/lib/c/include \
     -I"$SRC_ROOT"/abi/include \
-    -I"$SRC_ROOT"/uspace/lib/c/arch/"$UARCH"/include "$@"
+    -I"$SRC_ROOT"/uspace/lib/c/arch/"$UARCH"/include
Index: uspace/app/bdsh/cmds/builtins/cd/cd.c
===================================================================
--- uspace/app/bdsh/cmds/builtins/cd/cd.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/builtins/cd/cd.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -57,8 +57,6 @@
 	previous_directory_set = true;
 
-	int rc = chdir(new_dir);
-	if (rc != EOK) {
-		return rc;
-	}
+	if (chdir(new_dir) != 0)
+		return errno;
 
 	str_cpy(previous_directory, PATH_MAX, previous_directory_tmp);
Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -244,5 +244,4 @@
 		
 		bytes = read(fd, buff + copied_bytes, bytes_to_read);
-		bytes += copied_bytes;
 		copied_bytes = 0;
 
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -27,4 +27,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -84,5 +85,5 @@
 	int r = stat(path, &s);
 
-	if (r)
+	if (r != 0)
 		return TYPE_NONE;
 	else if (s.is_directory)
@@ -234,5 +235,5 @@
 			 */
 			if (force && !interactive) {
-				if (unlink(dest_path)) {
+				if (unlink(dest_path) != 0) {
 					printf("Unable to remove %s\n",
 					    dest_path);
@@ -245,5 +246,5 @@
 				if (overwrite) {
 					printf("Overwriting file: %s\n", dest_path);
-					if (unlink(dest_path)) {
+					if (unlink(dest_path) != 0) {
 						printf("Unable to remove %s\n", dest_path);
 						goto exit;
@@ -294,5 +295,5 @@
 				merge_paths(dest_path, PATH_MAX, src_dirname);
 
-				if (mkdir(dest_path, 0) == -1) {
+				if (mkdir(dest_path, 0) != 0) {
 					printf("Unable to create "
 					    "dest directory %s\n", dest_path);
@@ -308,5 +309,5 @@
 			 * e.g. cp -r /src /data/new_dir_src
 			 */
-			if (mkdir(dest_path, 0)) {
+			if (mkdir(dest_path, 0) != 0) {
 				printf("Unable to create "
 				    "dest directory %s\n", dest_path);
@@ -405,6 +406,6 @@
 	}
 
-	while ((bytes = read_all(fd1, buff, blen)) > 0) {
-		if ((bytes = write_all(fd2, buff, bytes)) < 0)
+	while ((bytes = read(fd1, buff, blen)) > 0) {
+		if ((bytes = write(fd2, buff, bytes)) < 0)
 			break;
 		copied += bytes;
@@ -412,5 +413,5 @@
 
 	if (bytes < 0) {
-		printf("\nError copying %s, (%d)\n", src, bytes);
+		printf("\nError copying %s, (%d)\n", src, errno);
 		copied = bytes;
 	}
Index: uspace/app/bdsh/cmds/modules/ls/ls.c
===================================================================
--- uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/ls/ls.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -31,4 +31,5 @@
  * As more stuff is completed and exposed in libc, this will improve */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -187,5 +188,5 @@
 		if (rc != 0) {
 			printf("ls: skipping bogus node %s\n", buff);
-			printf("rc=%d\n", rc);
+			printf("error=%d\n", errno);
 			goto out;
 		}
@@ -314,5 +315,5 @@
 static unsigned int ls_scope(const char *path, struct dir_elem_t *de)
 {
-	if (stat(path, &de->s)) {
+	if (stat(path, &de->s) != 0) {
 		cli_error(CL_ENOENT, "%s", path);
 		return LS_BOGUS;
@@ -376,18 +377,23 @@
 		}
 	}
-	
+
 	argc -= optind;
-	
+
 	de.name = (char *) malloc(PATH_MAX);
 	if (!de.name) {
-		cli_error(CL_ENOMEM, "%s: ", cmdname);
+		cli_error(CL_ENOMEM, "%s: Out of memory", cmdname);
 		return CMD_FAILURE;
 	}
 	memset(de.name, 0, PATH_MAX);
-	
-	if (argc == 0)
-		getcwd(de.name, PATH_MAX);
-	else
+
+	if (argc == 0) {
+		if (getcwd(de.name, PATH_MAX) == NULL) {
+			cli_error(CL_EFAIL, "%s: Failed determining working "
+			    "directory", cmdname);
+			return CMD_FAILURE;
+		}
+	} else {
 		str_cpy(de.name, PATH_MAX, argv[optind]);
+	}
 
 	scope = ls_scope(de.name, &de);
Index: uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -89,5 +89,5 @@
 {
 	/* Ensure we would always work with absolute and canonified path. */
-	char *path = absolutize(user_path, NULL);
+	char *path = vfs_absolutize(user_path, NULL);
 	if (path == NULL) {
 		cli_error(CL_ENOMEM, "%s: path too big?", cmdname);
@@ -95,12 +95,10 @@
 	}
 
-	int rc;
 	int ret = 0;
 
 	if (!create_parents) {
-		rc = mkdir(path, 0);
-		if (rc != EOK) {
+		if (mkdir(path, 0) != 0) {
 			cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-			    cmdname, path, str_error(rc));
+			    cmdname, path, str_error(errno));
 			ret = 1;
 		}
@@ -137,12 +135,8 @@
 			char slash_char = path[prev_off];
 			path[prev_off] = 0;
-			rc = mkdir(path, 0);
-			if (rc == EEXIST) {
-				rc = EOK;
-			}
-
-			if (rc != EOK) {
+
+			if (mkdir(path, 0) != 0 && errno != EEXIST) {
 				cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-				    cmdname, path, str_error(rc));
+				    cmdname, path, str_error(errno));
 				ret = 1;
 				goto leave;
@@ -152,8 +146,7 @@
 		}
 		/* Create the final directory. */
-		rc = mkdir(path, 0);
-		if (rc != EOK) {
+		if (mkdir(path, 0) != 0) {
 			cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-			    cmdname, path, str_error(rc));
+			    cmdname, path, str_error(errno));
 			ret = 1;
 		}
@@ -214,5 +207,6 @@
 
 	if (follow && (argv[optind] != NULL)) {
-		chdir(argv[optind]);
+		if (chdir(argv[optind]) != 0)
+			printf("%s: Error switching to directory.", cmdname);
 	}
 
Index: uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -27,4 +27,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -166,8 +167,10 @@
 
 		if ((rc2 = lseek(fd, file_size - 1, SEEK_SET)) < 0)
-			goto exit;
+			goto error;
 
 		rc2 = write(fd, &byte, sizeof(char));
-		goto exit;
+		if (rc2 < 0)
+			goto error;
+		return CMD_SUCCESS;
 	}
 
@@ -183,5 +186,5 @@
 		rc = write(fd, buffer, to_write);
 		if (rc <= 0) {
-			printf("%s: Error writing file (%zd).\n", cmdname, rc);
+			printf("%s: Error writing file (%d).\n", cmdname, errno);
 			close(fd);
 			return CMD_FAILURE;
@@ -191,12 +194,11 @@
 
 	free(buffer);
-exit:
-	rc = close(fd);
-
-	if (rc != 0 || rc2 < 0) {
-		printf("%s: Error writing file (%zd).\n", cmdname, rc);
-		return CMD_FAILURE;
-	}
+
+	if (close(fd) < 0)
+		goto error;
 
 	return CMD_SUCCESS;
+error:
+	printf("%s: Error writing file (%d).\n", cmdname, errno);
+	return CMD_FAILURE;
 }
Index: uspace/app/bdsh/cmds/modules/mount/mount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -72,5 +72,5 @@
 	int rc;
 
-	get_mtab_list(&mtab_list);
+	vfs_get_mtab_list(&mtab_list);
 
 	list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
@@ -150,5 +150,5 @@
 		mopts = t_argv[4];
 
-	rc = mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
+	rc = vfs_mount(t_argv[1], t_argv[2], dev, mopts, 0, instance);
 	if (rc != EOK) {
 		printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n",
Index: uspace/app/bdsh/cmds/modules/mv/mv.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mv/mv.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/mv/mv.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -60,7 +60,7 @@
 
 	rc = rename(argv[1], argv[2]);
-	if (rc != EOK) {
-		printf("Unable to rename %s to %s (rc=%d)\n",
-		    argv[1], argv[2], rc);
+	if (rc != 0) {
+		printf("Unable to rename %s to %s (error=%d)\n",
+		    argv[1], argv[2], errno);
 		return CMD_FAILURE;
 	}
Index: uspace/app/bdsh/cmds/modules/pwd/pwd.c
===================================================================
--- uspace/app/bdsh/cmds/modules/pwd/pwd.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/pwd/pwd.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -56,7 +56,6 @@
 
 	memset(buff, 0, PATH_MAX);
-	getcwd(buff, PATH_MAX);
 
-	if (! buff) {
+	if (getcwd(buff, PATH_MAX) == NULL) {
 		cli_error(CL_EFAIL,
 			"Unable to determine the current working directory");
Index: uspace/app/bdsh/cmds/modules/rm/rm.c
===================================================================
--- uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -27,4 +27,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -131,5 +132,5 @@
 static unsigned int rm_single(const char *path)
 {
-	if (unlink(path)) {
+	if (unlink(path) != 0) {
 		cli_error(CL_EFAIL, "rm: could not remove file %s", path);
 		return 1;
@@ -150,5 +151,5 @@
 
 	fd = open(path, O_RDONLY);
-	if (fd > 0) {
+	if (fd >= 0) {
 		close(fd);
 		return RM_FILE;
@@ -210,5 +211,5 @@
 	rc = rmdir(path);
 	if (rc == 0)
-		return ret;
+		return errno;
 
 	cli_error(CL_ENOTSUP, "Can not remove %s", path);
Index: uspace/app/bdsh/cmds/modules/touch/touch.c
===================================================================
--- uspace/app/bdsh/cmds/modules/touch/touch.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/touch/touch.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -123,5 +123,5 @@
 		
 		/* Check whether file exists if -c (--no-create) option is given */
-		if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == EOK)))
+		if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == 0)))
 			fd = open(buff, O_RDWR | O_CREAT);
 		
Index: uspace/app/bdsh/cmds/modules/unmount/unmount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/unmount/unmount.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/cmds/modules/unmount/unmount.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -66,5 +66,5 @@
 	}
 
-	rc = unmount(argv[1]);
+	rc = vfs_unmount(argv[1]);
 	if (rc != EOK) {
 		printf("Unable to unmount %s (rc=%d)\n", argv[1], rc);
Index: uspace/app/bdsh/compl.c
===================================================================
--- uspace/app/bdsh/compl.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/compl.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -360,5 +360,5 @@
 				asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name);
 				struct stat ent_stat;
-				if (stat(ent_path, &ent_stat) != EOK) {
+				if (stat(ent_path, &ent_stat) != 0) {
 					/* Error */
 					free(ent_path);
Index: uspace/app/bdsh/config.h
===================================================================
--- uspace/app/bdsh/config.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/config.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -46,6 +46,6 @@
 /* How many words (arguments) are permitted, how big can a whole
  * sentence be? Similar to ARG_MAX */
-#define WORD_MAX 255
-#define INPUT_MAX 1024
+#define WORD_MAX 1023
+#define INPUT_MAX 4096
 
 /* Leftovers from Autoconf */
Index: uspace/app/bdsh/errors.h
===================================================================
--- uspace/app/bdsh/errors.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/errors.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -42,5 +42,5 @@
 #define CL_ENOTSUP 6
 #define CL_EEXEC   7
-#define CL_EEXISTS 8
+#define CL_EEXIST  8
 #define CL_ETOOBIG 9
 
Index: uspace/app/bdsh/exec.c
===================================================================
--- uspace/app/bdsh/exec.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/bdsh/exec.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -61,5 +61,5 @@
 
 	fd = open(f, O_RDONLY);
-	if (fd > -1) {
+	if (fd >= 0) {
 		close(fd);
 		return 0;
@@ -113,5 +113,5 @@
 	
 	for (i = 0; i < 3 && files[i] != NULL; i++) {
-		if (fhandle(files[i], &file_handles[i]) == EOK) {
+		if (vfs_fhandle(files[i], &file_handles[i]) == EOK) {
 			file_handles_p[i] = &file_handles[i];
 		}
Index: uspace/app/df/df.c
===================================================================
--- uspace/app/df/df.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/df/df.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -119,10 +119,14 @@
 
 	LIST_INITIALIZE(mtab_list);
-	get_mtab_list(&mtab_list);
+	vfs_get_mtab_list(&mtab_list);
 
 	print_header();
 	list_foreach(mtab_list, link, mtab_ent_t, mtab_ent) {
-		statfs(mtab_ent->mp, &st);
-		print_statfs(&st, mtab_ent->fs_name, mtab_ent->mp);
+		if (statfs(mtab_ent->mp, &st) == 0) {
+			print_statfs(&st, mtab_ent->fs_name, mtab_ent->mp);
+		} else {
+			fprintf(stderr, "Cannot get information for '%s' (%d).\n",
+			    mtab_ent->mp, errno);
+		}
 	}
 
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/init/init.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -126,5 +126,5 @@
 		opts = "restore";
 	
-	int rc = mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts,
+	int rc = vfs_mount(fstype, ROOT_MOUNT_POINT, ROOT_DEVICE, opts,
 	    IPC_FLAG_BLOCKING, 0);
 	return mount_report("Root filesystem", ROOT_MOUNT_POINT, fstype,
@@ -143,5 +143,5 @@
 static bool mount_locfs(void)
 {
-	int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
+	int rc = vfs_mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
 	    IPC_FLAG_BLOCKING, 0);
 	return mount_report("Location service filesystem", LOCFS_MOUNT_POINT,
@@ -152,5 +152,5 @@
 {
 	struct stat s;
-	if (stat(path, &s) == ENOENT) {
+	if (stat(path, &s) != 0) {
 		printf("%s: Unable to stat %s\n", NAME, path);
 		return ENOENT;
@@ -299,5 +299,5 @@
 static bool mount_tmpfs(void)
 {
-	int rc = mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0, 0);
+	int rc = vfs_mount(TMPFS_FS_TYPE, TMPFS_MOUNT_POINT, "", "", 0, 0);
 	return mount_report("Temporary filesystem", TMPFS_MOUNT_POINT,
 	    TMPFS_FS_TYPE, NULL, rc);
Index: uspace/app/taskdump/elf_core.c
===================================================================
--- uspace/app/taskdump/elf_core.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/taskdump/elf_core.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -207,5 +207,5 @@
 	}
 
-	rc = write_all(fd, &elf_hdr, sizeof(elf_hdr));
+	rc = write(fd, &elf_hdr, sizeof(elf_hdr));
 	if (rc != sizeof(elf_hdr)) {
 		printf("Failed writing ELF header.\n");
@@ -215,5 +215,5 @@
 
 	for (i = 0; i < n_ph; ++i) {
-		rc = write_all(fd, &p_hdr[i], sizeof(p_hdr[i]));
+		rc = write(fd, &p_hdr[i], sizeof(p_hdr[i]));
 		if (rc != sizeof(p_hdr[i])) {
 			printf("Failed writing program header.\n");
@@ -236,5 +236,5 @@
 	note.type = NT_PRSTATUS;
 
-	rc = write_all(fd, &note, sizeof(elf_note_t));
+	rc = write(fd, &note, sizeof(elf_note_t));
 	if (rc != sizeof(elf_note_t)) {
 		printf("Failed writing note header.\n");
@@ -243,5 +243,5 @@
 	}
 
-	rc = write_all(fd, "CORE", note.namesz);
+	rc = write(fd, "CORE", note.namesz);
 	if (rc != (ssize_t) note.namesz) {
 		printf("Failed writing note header.\n");
@@ -257,5 +257,5 @@
 	}
 
-	rc = write_all(fd, &pr_status, sizeof(elf_prstatus_t));
+	rc = write(fd, &pr_status, sizeof(elf_prstatus_t));
 	if (rc != sizeof(elf_prstatus_t)) {
 		printf("Failed writing register data.\n");
@@ -321,5 +321,5 @@
 		}
 
-		rc = write_all(fd, buffer, to_copy);
+		rc = write(fd, buffer, to_copy);
 		if (rc != (ssize_t) to_copy) {
 			printf("Failed writing memory contents.\n");
Index: uspace/app/taskdump/symtab.c
===================================================================
--- uspace/app/taskdump/symtab.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/taskdump/symtab.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -88,5 +88,5 @@
 	}
 
-	rc = read_all(fd, &elf_hdr, sizeof(elf_header_t));
+	rc = read(fd, &elf_hdr, sizeof(elf_header_t));
 	if (rc != sizeof(elf_header_t)) {
 		printf("failed reading elf header\n");
@@ -310,5 +310,5 @@
 		return EIO;
 
-	rc = read_all(fd, sec_hdr, sizeof(elf_section_header_t));
+	rc = read(fd, sec_hdr, sizeof(elf_section_header_t));
 	if (rc != sizeof(elf_section_header_t))
 		return EIO;
@@ -346,5 +346,5 @@
 	}
 
-	rc = read_all(fd, *ptr, size);
+	rc = read(fd, *ptr, size);
 	if (rc != (ssize_t) size) {
 		printf("failed reading chunk\n");
Index: uspace/app/tester/float/float2.c
===================================================================
--- uspace/app/tester/float/float2.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/tester/float/float2.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -42,4 +42,21 @@
 };
 
+static double arguments_acos[OPERANDS] = {
+	-0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,
+	0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,
+	0.540302305868
+};
+
+static double arguments_asin[OPERANDS] = {
+	-0.350783227690, -0.863209366649, -0.506365641110, -0.262374853704,
+	0.158533380044, 0.0, 0.980815184715, -0.206379975025, -0.044182448332,
+	0.841470984808
+};
+
+static double arguments_atan[OPERANDS] = {
+	3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
+	2.718281828459045, 9.9, 0.001
+};
+
 static double arguments_exp[OPERANDS] = {
 	3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.1, -66.0
@@ -51,4 +68,30 @@
 };
 
+static double arguments_sqrt[OPERANDS] = {
+	3.5, 100.0, 50.0, 768.3156, 1080.499999, 1.0, 66.0,
+	2.718281828459045, 9.9, 0.001
+};
+
+static double arguments_tanh[OPERANDS] = {
+	3.5, -2.1, 50.0, 0.0, 1.0, 13.2, -1.1, -5.5, 0.000001, -66000000.0
+};
+
+static double results_acos[OPERANDS] = {
+	2.783185307180, 2.100000000000, 0.530964914873, 0.265482457437,
+	0.159205070272, 0.000000000000, 1.766992524091, 0.207873834887,
+	3.097395817941, 1.000000000000
+};
+
+static double results_asin[OPERANDS] = {
+	-0.358407346411, -1.041592653590, -0.530964914874, -0.265482457437,
+	0.159205070273, 0.000000000000, 1.374600129498, -0.207873834889,
+	-0.044196835651, 1.000000000000
+};
+
+static double results_atan[OPERANDS] = {
+	1.292496667790, 1.560796660108, 1.550798992822, 1.569494779052,
+	1.569870829603, 0.785398163397, 1.555645970920, 1.218282905017,
+	1.470127674637, 0.000999999667
+};
 
 static double results_ceil[OPERANDS] = {
@@ -56,10 +99,40 @@
 };
 
+static double results_cos[OPERANDS] = {
+	-0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,
+	0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,
+	0.540302305868
+};
+
+static double results_cosh[OPERANDS] = {
+	16.572824671057, 4.144313170410, 2592352764293536022528.000000000000,
+	1.000000000000, 1.543080634815, 270182.468624271103, 1.668518553822,
+	122.348009517829, 1.005004168056, 23035933171656458903220125696.0
+};
+
+static double results_fabs[OPERANDS] = {
+	3.5, 2.1, 100.0, 50.0, 1024.0, 0.0, 768.3156, 1080.499999, 600.0, 1.0
+};
+
 static double results_floor[OPERANDS] = {
 	3.0, -3.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0
 };
 
-static double results_trunc[OPERANDS] = {
-	3.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0
+static double results_exp[OPERANDS] = {
+	33.115451958692, 0.122456428253, 5184705528587072045056.0,
+	1.000000000000, 2.718281828459, 540364.937246691552, 0.332871083698,
+	0.004086771438, 1.105170918076, 0.000000000000
+};
+
+static double results_log[OPERANDS] = {
+	1.252762968495, 4.605170185988, 3.912023005428, 6.644200586236,
+	6.985179175021, 0.000000000000, 4.189654742026, 1.000000000000,
+	2.292534757141, -6.907755278982
+};
+
+static double results_log10[OPERANDS] = {
+	0.544068044350, 2.000000000000, 1.698970004336, 2.885539651261,
+	3.033624770817, 0.000000000000, 1.819543935542, 0.434294481903,
+	0.995635194598, -3.000000000000
 };
 
@@ -70,20 +143,30 @@
 };
 
-static double results_cos[OPERANDS] = {
-	-0.936456687291, -0.504846104600, 0.862318872288, 0.964966028492,
-	0.987353618220, 1.0, -0.194939922623, 0.978471923925, -0.999023478833,
-	0.540302305868
-};
-
-static double results_log[OPERANDS] = {
-	1.252762968495, 4.605170185988, 3.912023005428, 6.644200586236,
-	6.985179175021, 0.000000000000, 4.189654742026, 1.000000000000,
-	2.292534757141, -6.907755278982
-};
-
-static double results_exp[OPERANDS] = {
-	33.115451958692, 0.122456428253, 5184705528587072045056.0,
-	1.000000000000, 2.718281828459, 540364.937246691552, 0.332871083698,
-	0.004086771438, 1.105170918076, 0.000000000000
+static double results_sinh[OPERANDS] = {
+	16.542627287635, -4.021856742157, 2592352764293536022528.000000000000,
+	0.000000000000, 1.175201193644, 270182.468622420449, -1.335647470124,
+	-122.343922746391, 0.100166750020, -23035933171656458903220125696.0
+};
+
+static double results_sqrt[OPERANDS] = {
+	1.870828693387, 10.000000000000, 7.071067811865, 27.718506453271,
+	32.870959812576, 1.000000000000, 8.124038404636, 1.648721270700,
+	3.146426544510, 0.031622776602
+};
+
+static double results_tan[OPERANDS] = {
+	0.374585640159, 1.709846542905, -0.587213915157, -0.271900611998,
+	0.160563932839, 0.000000000000, -5.031371570891, -0.210920691722,
+	0.044225635601, 1.557407724655
+};
+
+static double results_tanh[OPERANDS] = {
+	0.998177897611, -0.970451936613, 1.000000000000, 0.000000000000,
+	0.761594155956, 0.999999999993, -0.800499021761, -0.999966597156,
+	0.000001000000, -1.000000000000
+};
+
+static double results_trunc[OPERANDS] = {
+	3.0, -2.0, 100.0, 50.0, -1024.0, 0.0, 768.0, 1080.0, -600.0, 1.0
 };
 
@@ -125,25 +208,321 @@
 {
 	bool fail = false;
+if (0) {
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = acos(arguments_acos[i]);
+
+		if (!cmp_double(res, results_acos[i])) {
+			TPRINTF("Double precision acos failed "
+			    "(%lf != %lf, arg %u)\n", res, results_acos[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = acosf(arguments_acos[i]);
+
+		if (!cmp_float(res, results_acos[i])) {
+			TPRINTF("Single precision acos failed "
+			    "(%f != %lf, arg %u)\n", res, results_acos[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = asin(arguments_asin[i]);
+
+		if (!cmp_double(res, results_asin[i])) {
+			TPRINTF("Double precision asin failed "
+			    "(%lf != %lf, arg %u)\n", res, results_asin[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = asinf(arguments_asin[i]);
+
+		if (!cmp_float(res, results_asin[i])) {
+			TPRINTF("Single precision asin failed "
+			    "(%f != %lf, arg %u)\n", res, results_asin[i], i);
+			fail = true;
+		}
+	}
+}
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = atan(arguments_atan[i]);
+
+		if (!cmp_double(res, results_atan[i])) {
+			TPRINTF("Double precision atan failed "
+			    "(%.12lf != %.12lf, arg %u)\n", res, results_atan[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = atanf(arguments_atan[i]);
+
+		if (!cmp_float(res, results_atan[i])) {
+			TPRINTF("Single precision atan failed "
+			    "(%f != %lf, arg %u)\n", res, results_atan[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = ceil(arguments[i]);
+
+		if (!cmp_double(res, results_ceil[i])) {
+			TPRINTF("Double precision ceil failed "
+			    "(%lf != %lf, arg %u)\n", res, results_ceil[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = ceilf(arguments[i]);
+
+		if (!cmp_float(res, results_ceil[i])) {
+			TPRINTF("Single precision ceil failed "
+			    "(%f != %lf, arg %u)\n", res, results_ceil[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = cos(arguments[i]);
+
+		if (!cmp_double(res, results_cos[i])) {
+			TPRINTF("Double precision cos failed "
+			    "(%lf != %lf, arg %u)\n", res, results_cos[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = cosf(arguments[i]);
+
+		if (!cmp_float(res, results_cos[i])) {
+			TPRINTF("Single precision cos failed "
+			    "(%f != %lf, arg %u)\n", res, results_cos[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = cosh(arguments_exp[i]);
+
+		if (!cmp_double(res, results_cosh[i])) {
+			TPRINTF("Double precision cosh failed "
+			    "(%lf != %lf, arg %u)\n", res, results_cosh[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = coshf(arguments_exp[i]);
+
+		if (!cmp_float(res, results_cosh[i])) {
+			TPRINTF("Single precision cosh failed "
+			    "(%f != %lf, arg %u)\n", res, results_cosh[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = exp(arguments_exp[i]);
+
+		if (!cmp_double(res, results_exp[i])) {
+			TPRINTF("Double precision exp failed "
+			    "(%lf != %lf, arg %u)\n", res, results_exp[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = expf(arguments_exp[i]);
+
+		if (!cmp_float(res, results_exp[i])) {
+			TPRINTF("Single precision exp failed "
+			    "(%f != %lf, arg %u)\n", res, results_exp[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = fabs(arguments[i]);
+
+		if (!cmp_double(res, results_fabs[i])) {
+			TPRINTF("Double precision fabs failed "
+			    "(%lf != %lf, arg %u)\n", res, results_fabs[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = fabsf(arguments[i]);
+
+		if (!cmp_float(res, results_fabs[i])) {
+			TPRINTF("Single precision fabs failed "
+			    "(%f != %lf, arg %u)\n", res, results_fabs[i], i);
+			fail = true;
+		}
+	}
 
 	for (unsigned int i = 0; i < OPERANDS; i++) {
 		double res = floor(arguments[i]);
-		int64_t res_int = (int64_t) (res * PRECISION);
-		int64_t corr_int = (int64_t) (results_floor[i] * PRECISION);
-		
-		if (res_int != corr_int) {
-			TPRINTF("Double precision floor failed (%" PRId64
-			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
-			fail = true;
-		}
-	}
-
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		double res = ceil(arguments[i]);
-		int64_t res_int = (int64_t) (res * PRECISION);
-		int64_t corr_int = (int64_t) (results_ceil[i] * PRECISION);
-		
-		if (res_int != corr_int) {
-			TPRINTF("Double precision ceil failed (%" PRId64
-			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
+
+		if (!cmp_double(res, results_floor[i])) {
+			TPRINTF("Double precision floor failed "
+			    "(%lf != %lf, arg %u)\n", res, results_floor[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = floorf(arguments[i]);
+
+		if (!cmp_float(res, results_floor[i])) {
+			TPRINTF("Single precision floor failed "
+			    "(%f != %lf, arg %u)\n", res, results_floor[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = log(arguments_log[i]);
+
+		if (!cmp_double(res, results_log[i])) {
+			TPRINTF("Double precision log failed "
+			    "(%lf != %lf, arg %u)\n", res, results_log[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = logf(arguments_log[i]);
+
+		if (!cmp_float(res, results_log[i])) {
+			TPRINTF("Single precision log failed "
+			    "(%f != %lf, arg %u)\n", res, results_log[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = log10(arguments_log[i]);
+
+		if (!cmp_double(res, results_log10[i])) {
+			TPRINTF("Double precision log10 failed "
+			    "(%lf != %lf, arg %u)\n", res, results_log10[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = log10f(arguments_log[i]);
+
+		if (!cmp_float(res, results_log10[i])) {
+			TPRINTF("Single precision log10 failed "
+			    "(%f != %lf, arg %u)\n", res, results_log10[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = sin(arguments[i]);
+
+		if (!cmp_double(res, results_sin[i])) {
+			TPRINTF("Double precision sin failed "
+			    "(%lf != %lf, arg %u)\n", res, results_sin[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = sinf(arguments[i]);
+
+		if (!cmp_float(res, results_sin[i])) {
+			TPRINTF("Single precision sin failed "
+			    "(%f != %lf, arg %u)\n", res, results_sin[i], i);
+			fail = true;
+		}
+	}
+;
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = sinh(arguments_exp[i]);
+
+		if (!cmp_double(res, results_sinh[i])) {
+			TPRINTF("Double precision sinh failed "
+			    "(%lf != %lf, arg %u)\n", res, results_sinh[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = sinhf(arguments_exp[i]);
+
+		if (!cmp_float(res, results_sinh[i])) {
+			TPRINTF("Single precision sinh failed "
+			    "(%f != %lf, arg %u)\n", res, results_sinh[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = sqrt(arguments_sqrt[i]);
+
+		if (!cmp_double(res, results_sqrt[i])) {
+			TPRINTF("Double precision sqrt failed "
+			    "(%lf != %lf, arg %u)\n", res, results_sqrt[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = sqrtf(arguments_sqrt[i]);
+
+		if (!cmp_float(res, results_sqrt[i])) {
+			TPRINTF("Single precision sqrt failed "
+			    "(%f != %lf, arg %u)\n", res, results_sqrt[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = tan(arguments[i]);
+
+		if (!cmp_double(res, results_tan[i])) {
+			TPRINTF("Double precision tan failed "
+			    "(%lf != %lf, arg %u)\n", res, results_tan[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = tanf(arguments[i]);
+
+		if (!cmp_float(res, results_tan[i])) {
+			TPRINTF("Single precision tan failed "
+			    "(%f != %lf, arg %u)\n", res, results_tan[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		double res = tanh(arguments_tanh[i]);
+
+		if (!cmp_double(res, results_tanh[i])) {
+			TPRINTF("Double precision tanh failed "
+			    "(%lf != %lf, arg %u)\n", res, results_tanh[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = tanhf(arguments_tanh[i]);
+
+		if (!cmp_float(res, results_tanh[i])) {
+			TPRINTF("Single precision tanh failed "
+			    "(%f != %lf, arg %u)\n", res, results_tanh[i], i);
 			fail = true;
 		}
@@ -152,81 +531,25 @@
 	for (unsigned int i = 0; i < OPERANDS; i++) {
 		double res = trunc(arguments[i]);
-		int64_t res_int = (int64_t) (res * PRECISION);
-		int64_t corr_int = (int64_t) (results_trunc[i] * PRECISION);
-		
-		if (res_int != corr_int) {
-			TPRINTF("Double precisiontruncation failed (%" PRId64
-			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
-			fail = true;
-		}
-	}
-	
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		double res = sin(arguments[i]);
-		int64_t res_int = (int64_t) (res * PRECISION);
-		int64_t corr_int = (int64_t) (results_sin[i] * PRECISION);
-		
-		if (res_int != corr_int) {
-			TPRINTF("Double precision sine failed (%" PRId64
-			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
-			fail = true;
-		}
-	}
-	
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		double res = cos(arguments[i]);
-		int64_t res_int = (int64_t) (res * PRECISION);
-		int64_t corr_int = (int64_t) (results_cos[i] * PRECISION);
-		
-		if (res_int != corr_int) {
-			TPRINTF("Double precision cosine failed (%" PRId64
-			    " != %" PRId64 ", arg %u)\n", res_int, corr_int, i);
-			fail = true;
-		}
-	}
-	
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		float res = logf(arguments_log[i]);
-		
-		if (!cmp_float(res, results_log[i])) {
-			TPRINTF("Single precision logarithm failed "
-			    "(%lf != %lf, arg %u)\n", res, results_log[i], i);
-			fail = true;
-		}
-	}
-	
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		double res = log(arguments_log[i]);
-		
-		if (!cmp_double(res, results_log[i])) {
-			TPRINTF("Double precision logarithm failed "
-			    "(%lf != %lf, arg %u)\n", res, results_log[i], i);
-			fail = true;
-		}
-	}
-	
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		float res = exp(arguments_exp[i]);
-		
-		if (!cmp_float(res, results_exp[i])) {
-			TPRINTF("Single precision exponential failed "
-			    "(%lf != %lf, arg %u)\n", res, results_exp[i], i);
-			fail = true;
-		}
-	}
-	
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		double res = exp(arguments_exp[i]);
-		
-		if (!cmp_double(res, results_exp[i])) {
-			TPRINTF("Double precision exponential failed "
-			    "(%lf != %lf, arg %u)\n", res, results_exp[i], i);
-			fail = true;
-		}
-	}
-	
+
+		if (!cmp_double(res, results_trunc[i])) {
+			TPRINTF("Double precision trunc failed "
+			    "(%lf != %lf, arg %u)\n", res, results_trunc[i], i);
+			fail = true;
+		}
+	}
+
+	for (unsigned int i = 0; i < OPERANDS; i++) {
+		float res = truncf(arguments[i]);
+
+		if (!cmp_float(res, results_trunc[i])) {
+			TPRINTF("Single precision trunc failed "
+			    "(%f != %lf, arg %u)\n", res, results_trunc[i], i);
+			fail = true;
+		}
+	}
+
 	if (fail)
 		return "Floating point imprecision";
-	
+
 	return NULL;
 }
Index: uspace/app/tester/hw/misc/virtchar1.c
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/tester/hw/misc/virtchar1.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -58,5 +58,5 @@
 	int fd = open(path, O_RDONLY);
 	if (fd < 0) {
-		TPRINTF("   ...error: %s\n", str_error(fd));
+		TPRINTF("   ...error: %s\n", str_error(errno));
 		if (fd == ENOENT) {
 			TPRINTF("   (error was ENOENT: " \
@@ -69,5 +69,5 @@
 	
 	TPRINTF(" Asking for session...\n");
-	async_sess_t *sess = fd_session(fd, INTERFACE_DDF);
+	async_sess_t *sess = vfs_fd_session(fd, INTERFACE_DDF);
 	if (!sess) {
 		close(fd);
Index: uspace/app/tester/tester.h
===================================================================
--- uspace/app/tester/tester.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/tester/tester.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -60,5 +60,5 @@
 	do { \
 		if (!test_quiet) { \
-			fprintf(stderr, (format), ##__VA_ARGS__); \
+			fprintf(stdout, (format), ##__VA_ARGS__); \
 		} \
 	} while (0)
Index: uspace/app/tester/vfs/vfs1.c
===================================================================
--- uspace/app/tester/vfs/vfs1.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/tester/vfs/vfs1.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -70,7 +70,6 @@
 const char *test_vfs1(void)
 {
-	int rc;
-	if ((rc = mkdir(TEST_DIRECTORY, 0)) != 0) {
-		TPRINTF("rc=%d\n", rc);
+	if (mkdir(TEST_DIRECTORY, 0) != 0) {
+		TPRINTF("rc=%d\n", errno);
 		return "mkdir() failed";
 	}
@@ -93,5 +92,7 @@
 	
 	char buf[BUF_SIZE];
+	TPRINTF("read..\n");
 	while ((cnt = read(fd0, buf, BUF_SIZE))) {
+		TPRINTF("read returns %zd\n", cnt);
 		if (cnt < 0)
 			return "read() failed";
@@ -112,13 +113,13 @@
 		return rv;
 	
-	if (rename(TEST_FILE, TEST_FILE2))
+	if (rename(TEST_FILE, TEST_FILE2) != 0)
 		return "rename() failed";
 	TPRINTF("Renamed %s to %s\n", TEST_FILE, TEST_FILE2);
 	
-	if (unlink(TEST_FILE2))
+	if (unlink(TEST_FILE2) != 0)
 		return "unlink() failed";
 	TPRINTF("Unlinked %s\n", TEST_FILE2);
 	
-	if (rmdir(TEST_DIRECTORY))
+	if (rmdir(TEST_DIRECTORY) != 0)
 		return "rmdir() failed";
 	TPRINTF("Removed directory %s\n", TEST_DIRECTORY);
Index: uspace/app/tetris/scores.c
===================================================================
--- uspace/app/tetris/scores.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/tetris/scores.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -233,4 +233,9 @@
 
 	f = fopen("/data/tetris.sco", "wb");
+	if (f == NULL) {
+		printf("Error creating table\n");
+		return;
+	}
+	
 	cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f);
 	rc = fclose(f);
Index: uspace/app/trace/errors.c
===================================================================
--- uspace/app/trace/errors.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/trace/errors.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -46,5 +46,5 @@
 	[-EPERM]	= { "EPERM",		"Permission denied" },
 	[-EHANGUP]	= { "EHANGUP",		"Answerbox closed connection" },
-	[-EEXISTS]	= { "EEXISTS",		"Entry already exists" },
+	[-EEXIST]	= { "EEXIST",		"Entry already exists" },
 	[-EBADMEM]	= { "EBADMEM",		"Bad memory pointer" },
 
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/trace/trace.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -57,5 +57,5 @@
 #include "proto.h"
 #include <ipc/services.h>
-#include "../../srv/vfs/vfs.h"
+#include <ipc/vfs.h>
 #include <ipc/console.h>
 
@@ -528,15 +528,15 @@
 	int fd_stderr;
 	
-	if ((stdin != NULL) && (fhandle(stdin, &fd_stdin) == EOK))
+	if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK))
 		files[0] = &fd_stdin;
 	else
 		files[0] = NULL;
 	
-	if ((stdout != NULL) && (fhandle(stdout, &fd_stdout) == EOK))
+	if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK))
 		files[1] = &fd_stdout;
 	else
 		files[1] = NULL;
 	
-	if ((stderr != NULL) && (fhandle(stderr, &fd_stderr) == EOK))
+	if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK))
 		files[2] = &fd_stderr;
 	else
Index: uspace/app/untar/main.c
===================================================================
--- uspace/app/untar/main.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/untar/main.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -103,13 +103,10 @@
 static int handle_directory(const tar_header_t *header, FILE *tarfile)
 {
-	int rc = mkdir(header->filename, 0755);
-	if ((rc == EEXIST) || (rc == EEXISTS)) {
-		// printf("Note: directory %s already exists.\n", header->filename);
-		rc = EOK;
-	}
-	if (rc != EOK) {
-		fprintf(stderr, "Failed to create directory %s: %s.\n",
-		    header->filename, str_error(rc));
-		return rc;
+	if (mkdir(header->filename, 0755) != 0) {
+		if (errno != EEXIST) {
+			fprintf(stderr, "Failed to create directory %s: %s.\n",
+			    header->filename, str_error(errno));
+			return errno;
+		}
 	}
 
Index: uspace/app/viewer/viewer.c
===================================================================
--- uspace/app/viewer/viewer.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/viewer/viewer.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -98,10 +98,10 @@
 {
 	int fd = open(fname, O_RDONLY);
-	if (fd < 0)
+	if (fd != 0)
 		return false;
 	
 	struct stat stat;
 	int rc = fstat(fd, &stat);
-	if (rc != EOK) {
+	if (rc != 0) {
 		close(fd);
 		return false;
@@ -114,5 +114,5 @@
 	}
 	
-	ssize_t rd = read_all(fd, tga, stat.size);
+	ssize_t rd = read(fd, tga, stat.size);
 	if ((rd < 0) || (rd != (ssize_t) stat.size)) {
 		free(tga);
Index: uspace/app/vuhid/device.c
===================================================================
--- uspace/app/vuhid/device.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/app/vuhid/device.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -123,5 +123,5 @@
 	/* Already used interface. */
 	if (iface->vuhid_data != NULL) {
-		return EEXISTS;
+		return EEXIST;
 	}
 
Index: uspace/drv/bus/isa/isa.c
===================================================================
--- uspace/drv/bus/isa/isa.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/drv/bus/isa/isa.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -270,5 +270,5 @@
 	}
 
-	r = read_all(fd, buf, len);
+	r = read(fd, buf, len);
 	if (r < 0) {
 		ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path);
Index: uspace/drv/test/test1/test1.c
===================================================================
--- uspace/drv/test/test1/test1.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/drv/test/test1/test1.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -186,5 +186,5 @@
 		(void) register_fun_verbose(dev,
 		    "cloning myself twice ;-)", "clone",
-		    "virtual&test1", 10, EEXISTS, NULL);
+		    "virtual&test1", 10, EEXIST, NULL);
 	} else if (str_cmp(dev_name, "clone") == 0) {
 		(void) register_fun_verbose(dev,
Index: uspace/lib/bithenge/src/file.c
===================================================================
--- uspace/lib/bithenge/src/file.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/bithenge/src/file.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -114,5 +114,5 @@
 	struct stat stat;
 	int rc = fstat(fd, &stat);
-	if (rc != EOK) {
+	if (rc != 0) {
 		if (needs_close)
 			close(fd);
@@ -157,5 +157,5 @@
 	int fd = open(filename, O_RDONLY);
 	if (fd < 0)
-		return fd;
+		return errno;
 
 	return new_file_blob(out, fd, true);
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/Makefile	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -67,5 +67,4 @@
 	generic/bd_srv.c \
 	generic/cap.c \
-	generic/cfg.c \
 	generic/clipboard.c \
 	generic/corecfg.c \
Index: uspace/lib/c/arch/abs32le/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/abs32le/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcabs32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_abs32_STDDEF_H_
+#define LIBC_abs32_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint32_t size_t;
+typedef int32_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/abs32le/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/abs32le/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcabs32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_abs32_STDINT_H_
+#define LIBC_abs32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MAX UINT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/abs32le/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/abs32le/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_abs32le_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -50,8 +49,5 @@
 
 typedef int32_t ssize_t;
-typedef uint32_t size_t;
 
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
 typedef uint32_t atomic_count_t;
 typedef int32_t atomic_signed_t;
Index: uspace/lib/c/arch/amd64/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/amd64/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/amd64/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcamd64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_amd64_STDDEF_H_
+#define LIBC_amd64_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint64_t size_t;
+typedef int64_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/amd64/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/amd64/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/amd64/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcamd64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_amd64_STDINT_H_
+#define LIBC_amd64_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+#define UINTPTR_MAX UINT64_MAX
+typedef uint64_t uintptr_t;
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+typedef int64_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/amd64/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/amd64/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/amd64/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_amd64_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __64_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT64_MIN
-#define SIZE_MAX  UINT64_MAX
 
 #define SSIZE_MIN  INT64_MIN
@@ -50,8 +49,5 @@
 
 typedef int64_t ssize_t;
-typedef uint64_t size_t;
 
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
 typedef uint64_t atomic_count_t;
 typedef int64_t atomic_signed_t;
Index: uspace/lib/c/arch/arm32/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/arm32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcarm32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_arm32_STDDEF_H_
+#define LIBC_arm32_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint32_t size_t;
+typedef int32_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/arm32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcarm32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_arm32_STDINT_H_
+#define LIBC_arm32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/arm32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/arm32/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,10 +37,9 @@
 #define LIBC_arm32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -51,8 +50,5 @@
 
 typedef int32_t ssize_t;
-typedef uint32_t size_t;
 
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
 typedef uint32_t atomic_count_t;
 typedef int32_t atomic_signed_t;
Index: uspace/lib/c/arch/ia32/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/ia32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/ia32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcia32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ia32_STDDEF_H_
+#define LIBC_ia32_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint32_t size_t;
+typedef int32_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ia32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/ia32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/ia32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcia32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ia32_STDINT_H_
+#define LIBC_ia32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ia32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/ia32/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/ia32/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_ia32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -52,6 +51,4 @@
 typedef uint32_t size_t;
 
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
 typedef uint32_t atomic_count_t;
 typedef int32_t atomic_signed_t;
Index: uspace/lib/c/arch/ia64/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/ia64/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/ia64/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcia64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ia64_STDDEF_H_
+#define LIBC_ia64_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint64_t size_t;
+typedef int64_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ia64/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/ia64/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/ia64/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcia64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ia64_STDINT_H_
+#define LIBC_ia64_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+#define UINTPTR_MAX UINT64_MAX
+typedef uint64_t uintptr_t;
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+typedef int64_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ia64/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/ia64/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/ia64/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_ia64_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __64_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT64_MIN
-#define SIZE_MAX  UINT64_MAX
 
 #define SSIZE_MIN  INT64_MIN
@@ -50,8 +49,5 @@
 
 typedef int64_t ssize_t;
-typedef uint64_t size_t;
 
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
 typedef uint64_t atomic_count_t;
 typedef int64_t atomic_signed_t;
Index: uspace/lib/c/arch/mips32/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/mips32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/mips32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcmips32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_mips32_STDDEF_H_
+#define LIBC_mips32_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint32_t size_t;
+typedef int32_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/mips32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/mips32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/mips32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcmips32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_mips32_STDINT_H_
+#define LIBC_mips32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/mips32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/mips32/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/mips32/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,10 +37,9 @@
 #define LIBC_mips32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -51,8 +50,5 @@
 
 typedef int32_t ssize_t;
-typedef uint32_t size_t;
 
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
 typedef uint32_t atomic_count_t;
 typedef int32_t atomic_signed_t;
Index: uspace/lib/c/arch/mips32eb/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/mips32eb/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/mips32eb/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,1 @@
+../../../mips32/include/libarch/stddef.h
Index: uspace/lib/c/arch/mips32eb/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/mips32eb/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/mips32eb/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,1 @@
+../../../mips32/include/libarch/stdint.h
Index: uspace/lib/c/arch/ppc32/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/ppc32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcppc32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ppc32_STDDEF_H_
+#define LIBC_ppc32_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint32_t size_t;
+typedef int32_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ppc32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/ppc32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcppc32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_ppc32_STDINT_H_
+#define LIBC_ppc32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/ppc32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/ppc32/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_ppc32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -50,8 +49,5 @@
 
 typedef int32_t ssize_t;
-typedef uint32_t size_t;
 
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
 typedef uint32_t atomic_count_t;
 typedef int32_t atomic_signed_t;
Index: uspace/lib/c/arch/sparc32/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/sparc32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/sparc32/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcsparc32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_sparc32_STDDEF_H_
+#define LIBC_sparc32_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint32_t size_t;
+typedef int32_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/sparc32/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/sparc32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/sparc32/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcsparc32
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_sparc32_STDINT_H_
+#define LIBC_sparc32_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT32_MIN
+#define SIZE_MAX  UINT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+typedef uint32_t uintptr_t;
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+typedef int32_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/sparc32/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/sparc32/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/sparc32/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_sparc32_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __32_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT32_MIN
-#define SIZE_MAX  UINT32_MAX
 
 #define SSIZE_MIN  INT32_MIN
@@ -50,8 +49,5 @@
 
 typedef int32_t ssize_t;
-typedef uint32_t size_t;
 
-typedef uint32_t uintptr_t;
-typedef int32_t intptr_t;
 typedef uint32_t atomic_count_t;
 typedef int32_t atomic_signed_t;
Index: uspace/lib/c/arch/sparc64/include/libarch/stddef.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/sparc64/include/libarch/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcsparc64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_sparc64_STDDEF_H_
+#define LIBC_sparc64_STDDEF_H_
+
+#include <libarch/common.h>
+
+typedef uint64_t size_t;
+typedef int64_t ptrdiff_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/sparc64/include/libarch/stdint.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/c/arch/sparc64/include/libarch/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * 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 libcsparc64
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_sparc64_STDINT_H_
+#define LIBC_sparc64_STDINT_H_
+
+#include <libarch/common.h>
+
+#define SIZE_MIN  UINT64_MIN
+#define SIZE_MAX  UINT64_MAX
+
+#define UINTPTR_MAX UINT64_MAX
+typedef uint64_t uintptr_t;
+
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+typedef int64_t intptr_t;
+
+#define UINTMAX_MAX UINT64_MAX
+typedef uint64_t uintmax_t;
+
+#define INTMAX_MAX INT64_MAX
+typedef int64_t intmax_t;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/arch/sparc64/include/libarch/types.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/libarch/types.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/arch/sparc64/include/libarch/types.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,10 +36,9 @@
 #define LIBC_sparc64_TYPES_H_
 
+#include <libarch/common.h>
+#include <libarch/stddef.h>
+#include <libarch/stdint.h>
+
 #define __64_BITS__
-
-#include <libarch/common.h>
-
-#define SIZE_MIN  UINT64_MIN
-#define SIZE_MAX  UINT64_MAX
 
 #define SSIZE_MIN  INT64_MIN
@@ -50,8 +49,5 @@
 
 typedef int64_t ssize_t;
-typedef uint64_t size_t;
 
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
 typedef uint64_t atomic_count_t;
 typedef int64_t atomic_signed_t;
Index: pace/lib/c/generic/cfg.c
===================================================================
--- uspace/lib/c/generic/cfg.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ 	(revision )
@@ -1,441 +1,0 @@
-/*
- * Copyright (c) 2011 Radim Vansa
- * 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 cfg.c
- * @brief Configuration files manipulation implementation.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <str.h>
-#include <errno.h>
-#include <assert.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <cfg.h>
-
-/**
- * @param data Configuration file data
- *
- * @return Anonymous section in the configuration file.
- * @return NULL if there is no such section (it is empty)
- *
- */
-const cfg_section_t *cfg_anonymous(const cfg_file_t *data)
-{
-	assert(data != NULL);
-	
-	if (list_empty(&data->sections))
-		return NULL;
-	
-	link_t *link = list_first(&data->sections);
-	const cfg_section_t *section = cfg_section_instance(link);
-	if (section->title[0] != 0)
-		return NULL;
-	
-	return section;
-}
-
-/**
- * @param data Configuration file data
- *
- * @return True if the file contains no data
- *         (no sections, neither anonymous).
- * @return False otherwise.
- *
- */
-bool cfg_empty(const cfg_file_t *data)
-{
-	assert(data != NULL);
-	
-	if (list_empty(&data->sections))
-		return true;
-	
-	cfg_file_foreach(data, section) {
-		if (!list_empty(&section->entries))
-			return false;
-	}
-	
-	return true;
-}
-
-/** Read file contents into memory.
- *
- * @param path Path to the file
- * @param buf  Pointer to pointer to buffer where
- *             the file contents will be stored
- *
- * @return EOK if the file was successfully loaded.
- * @return ENOMEM if there was not enough memory to load the file
- * @return EIO if there was a problem with reading the file
- * @return Other error code if there was a problem openening the file
- *
- */
-static int cfg_read(const char *path, char **buf)
-{
-	assert(buf != NULL);
-	
-	int fd = open(path, O_RDONLY);
-	if (fd < 0)
-		return fd;
-	
-	size_t len = lseek(fd, 0, SEEK_END);
-	lseek(fd, 0, SEEK_SET);
-	
-	*buf = malloc(len + 1);
-	if (*buf == NULL) {
-		close(fd);
-		return ENOMEM;
-	}
-	
-	ssize_t rd = read_all(fd, *buf, len);
-	if (rd < 0) {
-		free(*buf);
-		close(fd);
-		return EIO;
-	}
-	
-	(*buf)[len] = 0;
-	close(fd);
-	
-	return EOK;
-}
-
-static inline void null_back(char *back)
-{
-	do {
-		*back = 0;
-		back--;
-	} while (isspace(*back));
-}
-
-/** Allocate and initialize a new entry.
- *
- * @param key   Entry key
- * @param value Entry value
- *
- * @return New entry
- * @return NULL if there was not enough memory
- *
- */
-static cfg_entry_t *cfg_new_entry(const char *key, const char *value)
-{
-	cfg_entry_t *entry = malloc(sizeof(cfg_entry_t));
-	if (entry == NULL)
-		return NULL;
-	
-	link_initialize(&entry->link);
-	entry->key = key;
-	entry->value = value;
-	
-	return entry;
-}
-
-/** Allocate and initialize a new section.
- *
- * @param title Section title
- *
- * @return New section
- * @return NULL if there was not enough memory
- *
- */
-static cfg_section_t *cfg_new_section(const char *title)
-{
-	cfg_section_t *sec = malloc(sizeof(cfg_section_t));
-	if (sec == NULL)
-		return NULL;
-	
-	link_initialize(&sec->link);
-	
-	if (title != NULL)
-		sec->title = title;
-	else
-		sec->title = "";
-	
-	list_initialize(&sec->entries);
-	sec->entry_count = 0;
-	
-	return sec;
-}
-
-/** Skip whitespaces
- *
- */
-static inline void skip_whitespaces(char **buffer)
-{
-	while (isspace(**buffer))
-		(*buffer)++;
-}
-
-static inline int starts_comment(char c)
-{
-	return ((c == ';') || (c == '#'));
-}
-
-/** Load file content into memory
- *
- * Parse the file into sections and entries
- * and initialize data with this info.
- *
- * @param path Path to the configuration file
- * @param data Configuration file data
- *
- * @return EOK if the file was successfully loaded
- * @return EBADF if the configuration file has bad format.
- * @return ENOMEM if there was not enough memory
- * @return Error code from cfg_read()
- *
- */
-int cfg_load(const char *path, cfg_file_t *data)
-{
-	char *buffer;
-	int res = cfg_read(path, &buffer);
-	if (res != EOK)
-		return res;
-	
-	list_initialize(&data->sections);
-	data->section_count = 0;
-	data->data = buffer;
-	
-	cfg_section_t *curr_section = NULL;
-	skip_whitespaces(&buffer);
-	
-	while (*buffer) {
-		while (starts_comment(*buffer)) {
-			while ((*buffer) && (*buffer != '\n'))
-				buffer++;
-			
-			skip_whitespaces(&buffer);
-		}
-		
-		if (*buffer == '[') {
-			buffer++;
-			skip_whitespaces(&buffer);
-			
-			const char *title = buffer;
-			while ((*buffer) && (*buffer != ']') && (*buffer != '\n'))
-				buffer++;
-			
-			if (*buffer != ']') {
-				cfg_unload(data);
-				return EBADF;
-			}
-			
-			null_back(buffer);
-			buffer++;
-			
-			cfg_section_t *sec = cfg_new_section(title);
-			if (sec == NULL) {
-				cfg_unload(data);
-				return ENOMEM;
-			}
-			
-			list_append(&sec->link, &data->sections);
-			data->section_count++;
-			curr_section = sec;
-		} else if (*buffer) {
-			const char *key = buffer;
-			while ((*buffer) && (*buffer != '=') && (*buffer != '\n'))
-				buffer++;
-			
-			if (*buffer != '=') {
-				cfg_unload(data);
-				return EBADF;
-			}
-			
-			/* null = and whitespaces before */
-			null_back(buffer);
-			buffer++;
-			skip_whitespaces(&buffer);
-			
-			while (starts_comment(*buffer)) {
-				while ((*buffer) && (*buffer != '\n'))
-					buffer++;
-				
-				skip_whitespaces(&buffer);
-			}
-			
-			const char *value = buffer;
-			/* Empty value is correct value */
-			if (*buffer) {
-				while ((*buffer) && (*buffer != '\n'))
-					buffer++;
-				
-				if (*buffer) {
-					null_back(buffer);
-					buffer++;
-				} else
-					null_back(buffer);
-			}
-			
-			/* Create anonymous section if not present */
-			if (curr_section == NULL) {
-				curr_section = cfg_new_section(NULL);
-				if (curr_section == NULL) {
-					cfg_unload(data);
-					return ENOMEM;
-				}
-				
-				list_append(&curr_section->link, &data->sections);
-			}
-			
-			cfg_entry_t *entry = cfg_new_entry(key, value);
-			if (entry == NULL) {
-				cfg_unload(data);
-				return ENOMEM;
-			}
-			
-			list_append(&entry->link, &curr_section->entries);
-			curr_section->entry_count++;
-		}
-		
-		skip_whitespaces(&buffer);
-	}
-	
-	return EOK;
-}
-
-/** Load file content into memory (with path)
- *
- * Parse the file (with path) into sections and entries
- * and initialize data with this info.
- *
- */
-int cfg_load_path(const char *path, const char *fname, cfg_file_t *data)
-{
-	size_t sz = str_size(path) + str_size(fname) + 2;
-	char *name = malloc(sz);
-	if (name == NULL)
-		return ENOMEM;
-	
-	snprintf(name, sz, "%s/%s", path, fname);
-	int rc = cfg_load(name, data);
-	
-	free(name);
-	
-	return rc;
-}
-
-/** Deallocate memory used by entry
- *
- */
-static void cfg_free_entry(const cfg_entry_t *entry)
-{
-	assert(entry != NULL);
-	free(entry);
-}
-
-/** Deallocate memory used by all entries
- *
- * Deallocate memory used by all entries within a section
- * and the memory used by the section itself.
- *
- */
-static void cfg_free_section(const cfg_section_t *section)
-{
-	assert(section != NULL);
-	
-	link_t *cur;
-	link_t *next;
-	
-	for (cur = section->entries.head.next;
-	    cur != &section->entries.head;
-	    cur = next) {
-		next = cur->next;
-		cfg_free_entry(cfg_entry_instance(cur));
-	}
-	
-	free(section);
-}
-
-/** Deallocate memory used by configuration data
- *
- * Deallocate all inner sections and entries.
- *
- */
-void cfg_unload(cfg_file_t *data)
-{
-	assert(data != NULL);
-	
-	link_t *cur, *next;
-	for (cur = data->sections.head.next;
-	    cur != &data->sections.head;
-	    cur = next) {
-		next = cur->next;
-		cfg_free_section(cfg_section_instance(cur));
-	}
-	
-	free(data->data);
-}
-
-/** Find a section in the configuration data
- *
- * @param data  Configuration data
- * @param title Title of the section to search for
- *
- * @return Found section
- * @return NULL if there is no section with such title
- *
- */
-const cfg_section_t *cfg_find_section(const cfg_file_t *data, const char *title)
-{
-	cfg_file_foreach(data, section) {
-		if (str_cmp(section->title, title) == 0)
-			return section;
-	}
-	
-	return NULL;
-}
-
-/** Find entry value in the configuration data
- *
- * @param section Section in which to search
- * @param key     Key of the entry we to search for
- *
- * @return Value of the entry
- * @return NULL if there is no entry with such key
- *
- */
-const char *cfg_find_value(const cfg_section_t *section, const char *key)
-{
-	cfg_section_foreach(section, entry) {
-		if (str_cmp(entry->key, key) == 0)
-			return entry->value;
-	}
-	
-	return NULL;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/elf/elf_load.c
===================================================================
--- uspace/lib/c/generic/elf/elf_load.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/elf/elf_load.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -97,5 +97,5 @@
 	int fd;
 	int rc;
-	
+
 	fd = open(file_name, O_RDONLY);
 	if (fd < 0) {
@@ -147,5 +147,5 @@
 	int i, rc;
 
-	rc = read_all(elf->fd, header, sizeof(elf_header_t));
+	rc = read(elf->fd, header, sizeof(elf_header_t));
 	if (rc != sizeof(elf_header_t)) {
 		DPRINTF("Read error.\n"); 
@@ -209,5 +209,5 @@
 		        + i * sizeof(elf_segment_header_t), SEEK_SET);
 
-		rc = read_all(elf->fd, &segment_hdr,
+		rc = read(elf->fd, &segment_hdr,
 		    sizeof(elf_segment_header_t));
 		if (rc != sizeof(elf_segment_header_t)) {
@@ -231,5 +231,5 @@
 		    + i * sizeof(elf_section_header_t), SEEK_SET);
 
-		rc = read_all(elf->fd, &section_hdr,
+		rc = read(elf->fd, &section_hdr,
 		    sizeof(elf_section_header_t));
 		if (rc != sizeof(elf_section_header_t)) {
@@ -399,5 +399,5 @@
 		if (now > left) now = left;
 
-		rc = read_all(elf->fd, dp, now);
+		rc = read(elf->fd, dp, now);
 
 		if (rc != (ssize_t) now) { 
Index: uspace/lib/c/generic/io/console.c
===================================================================
--- uspace/lib/c/generic/io/console.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/io/console.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -49,5 +49,5 @@
 		return NULL;
 	
-	ctrl->input_sess = fsession(ifile, INTERFACE_CONSOLE);
+	ctrl->input_sess = vfs_fsession(ifile, INTERFACE_CONSOLE);
 	if (!ctrl->input_sess) {
 		free(ctrl);
@@ -55,5 +55,5 @@
 	}
 	
-	ctrl->output_sess = fsession(ofile, INTERFACE_CONSOLE);
+	ctrl->output_sess = vfs_fsession(ofile, INTERFACE_CONSOLE);
 	if (!ctrl->output_sess) {
 		free(ctrl);
Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/io/io.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -231,5 +231,5 @@
 	if (stream->buf == NULL) {
 		errno = ENOMEM;
-		return -1;
+		return EOF;
 	}
 	
@@ -299,5 +299,6 @@
 }
 
-int fclose(FILE *stream)
+
+static int _fclose_nofree(FILE *stream)
 {
 	int rc = 0;
@@ -312,4 +313,16 @@
 	
 	list_remove(&stream->link);
+	
+	if (rc != 0) {
+		/* errno was set by close() */
+		return EOF;
+	}
+	
+	return 0;
+}
+
+int fclose(FILE *stream)
+{
+	int rc = _fclose_nofree(stream);
 	
 	if ((stream != &stdin_null)
@@ -318,12 +331,30 @@
 		free(stream);
 	
-	stream = NULL;
-	
-	if (rc != 0) {
-		/* errno was set by close() */
-		return EOF;
-	}
-	
-	return 0;
+	return rc;
+}
+
+FILE *freopen(const char *path, const char *mode, FILE *stream)
+{
+	FILE *nstr;
+	
+	if (path == NULL) {
+		/* Changing mode is not supported */
+		return NULL;
+	}
+	
+	(void) _fclose_nofree(stream);
+	nstr = fopen(path, mode);
+	if (nstr == NULL) {
+		free(stream);
+		return NULL;
+	}
+	
+	list_remove(&nstr->link);
+	*stream = *nstr;
+	list_append(&stream->link, &files);
+	
+	free(nstr);
+	
+	return stream;
 }
 
@@ -334,4 +365,7 @@
  * @param nmemb  Number of records to read.
  * @param stream Pointer to the stream.
+ *
+ * @return Number of elements successfully read. On error this is less than
+ *         nmemb, stream error indicator is set and errno is set.
  */
 static size_t _fread(void *buf, size_t size, size_t nmemb, FILE *stream)
@@ -348,9 +382,10 @@
 		ssize_t rd = read(stream->fd, buf + done, left);
 		
-		if (rd < 0)
+		if (rd < 0) {
+			/* errno was set by read() */
 			stream->error = true;
-		else if (rd == 0)
+		} else if (rd == 0) {
 			stream->eof = true;
-		else {
+		} else {
 			left -= rd;
 			done += rd;
@@ -367,4 +402,7 @@
  * @param nmemb  Number of records to write.
  * @param stream Pointer to the stream.
+ *
+ * @return Number of elements successfully written. On error this is less than
+ *         nmemb, stream error indicator is set and errno is set.
  */
 static size_t _fwrite(const void *buf, size_t size, size_t nmemb, FILE *stream)
@@ -372,4 +410,5 @@
 	size_t left;
 	size_t done;
+	int rc;
 
 	if (size == 0 || nmemb == 0)
@@ -381,15 +420,29 @@
 	while ((left > 0) && (!stream->error)) {
 		ssize_t wr;
+		size_t uwr;
 		
-		if (stream->kio)
-			wr = kio_write(buf + done, left);
-		else
+		if (stream->kio) {
+			uwr = 0;
+			rc = kio_write(buf + done, left, &uwr);
+			if (rc != EOK)
+				errno = rc;
+		} else {
 			wr = write(stream->fd, buf + done, left);
+			if (wr >= 0) {
+				uwr = (size_t)wr;
+				rc = EOK;
+			} else {
+				/* errno was set by write */
+				uwr = 0;
+				rc = errno;
+			}
+		}
 		
-		if (wr <= 0)
+		if (rc != EOK) {
+			/* errno was set above */
 			stream->error = true;
-		else {
-			left -= wr;
-			done += wr;
+		} else {
+			left -= uwr;
+			done += uwr;
 		}
 	}
@@ -401,5 +454,8 @@
 }
 
-/** Read some data in stream buffer. */
+/** Read some data in stream buffer.
+ *
+ * On error, stream error indicator is set and errno is set.
+ */
 static void _ffillbuf(FILE *stream)
 {
@@ -410,4 +466,5 @@
 	rc = read(stream->fd, stream->buf, stream->buf_size);
 	if (rc < 0) {
+		/* errno was set by read() */
 		stream->error = true;
 		return;
@@ -434,10 +491,21 @@
 
 	/* If buffer has prefetched read data, we need to seek back. */
-	if (bytes_used > 0 && stream->buf_state == _bs_read)
-		lseek(stream->fd, - (ssize_t) bytes_used, SEEK_CUR);
+	if (bytes_used > 0 && stream->buf_state == _bs_read) {
+		off64_t rc;
+		rc = lseek(stream->fd, - (ssize_t) bytes_used, SEEK_CUR);
+		if (rc == (off64_t)-1) {
+			/* errno was set by lseek */
+			stream->error = 1;
+			return;
+		}
+	}
 
 	/* If buffer has unwritten data, we need to write them out. */
-	if (bytes_used > 0 && stream->buf_state == _bs_write)
+	if (bytes_used > 0 && stream->buf_state == _bs_write) {
 		(void) _fwrite(stream->buf_tail, 1, bytes_used, stream);
+		/* On error stream error indicator and errno are set by _fwrite */
+		if (stream->error)
+			return;
+	}
 
 	stream->buf_head = stream->buf;
@@ -466,8 +534,19 @@
 		return 0;
 
+	bytes_left = size * nmemb;
+	total_read = 0;
+	dp = (uint8_t *) dest;
+
+	/* Bytes from ungetc() buffer */
+	while (stream->ungetc_chars > 0 && bytes_left > 0) {
+		*dp++ = stream->ungetc_buf[--stream->ungetc_chars];
+		++total_read;
+		--bytes_left;
+	}
+
 	/* If not buffered stream, read in directly. */
 	if (stream->btype == _IONBF) {
-		now = _fread(dest, size, nmemb, stream);
-		return now;
+		total_read += _fread(dest, 1, bytes_left, stream);
+		return total_read / size;
 	}
 
@@ -482,14 +561,12 @@
 	}
 
-	bytes_left = size * nmemb;
-	total_read = 0;
-	dp = (uint8_t *) dest;
-
 	while ((!stream->error) && (!stream->eof) && (bytes_left > 0)) {
 		if (stream->buf_head == stream->buf_tail)
 			_ffillbuf(stream);
 
-		if (stream->error || stream->eof)
+		if (stream->error || stream->eof) {
+			/* On error errno was set by _ffillbuf() */
 			break;
+		}
 
 		data_avail = stream->buf_head - stream->buf_tail;
@@ -546,5 +623,4 @@
 	if (stream->buf_state == _bs_read)
 		_fflushbuf(stream);
-
 
 	/* Perform lazy allocation of stream buffer. */
@@ -584,5 +660,6 @@
 			/* Only need to drain buffer. */
 			_fflushbuf(stream);
-			need_flush = false;
+			if (!stream->error)
+				need_flush = false;
 		}
 	}
@@ -618,5 +695,8 @@
 int fputs(const char *str, FILE *stream)
 {
-	return fwrite(str, str_size(str), 1, stream);
+	(void) fwrite(str, str_size(str), 1, stream);
+	if (ferror(stream))
+		return EOF;
+	return 0;
 }
 
@@ -674,14 +754,38 @@
 }
 
+int ungetc(int c, FILE *stream)
+{
+	if (c == EOF)
+		return EOF;
+
+	if (stream->ungetc_chars >= UNGETC_MAX)
+		return EOF;
+
+	stream->ungetc_buf[stream->ungetc_chars++] =
+	    (uint8_t)c;
+
+	stream->eof = false;
+	return (uint8_t)c;
+}
+
 int fseek(FILE *stream, off64_t offset, int whence)
 {
 	off64_t rc;
 
+	if (stream->error)
+		return EOF;
+
 	_fflushbuf(stream);
+	if (stream->error) {
+		/* errno was set by _fflushbuf() */
+		return EOF;
+	}
+
+	stream->ungetc_chars = 0;
 
 	rc = lseek(stream->fd, offset, whence);
 	if (rc == (off64_t) (-1)) {
-		/* errno has been set by lseek64. */
-		return -1;
+		/* errno has been set by lseek() */
+		return EOF;
 	}
 
@@ -692,6 +796,22 @@
 off64_t ftell(FILE *stream)
 {
+	off64_t pos;
+	
+	if (stream->error)
+		return EOF;
+	
 	_fflushbuf(stream);
-	return lseek(stream->fd, 0, SEEK_CUR);
+	if (stream->error) {
+		/* errno was set by _fflushbuf() */
+		return EOF;
+	}
+
+	pos = lseek(stream->fd, 0, SEEK_CUR);
+	if (pos == (off64_t) -1) {
+		/* errno was set by lseek */
+		return (off64_t) -1;
+	}
+	
+	return pos - stream->ungetc_chars;
 }
 
@@ -703,9 +823,16 @@
 int fflush(FILE *stream)
 {
+	if (stream->error)
+		return EOF;
+	
 	_fflushbuf(stream);
+	if (stream->error) {
+		/* errno was set by _fflushbuf() */
+		return EOF;
+	}
 	
 	if (stream->kio) {
 		kio_update();
-		return EOK;
+		return 0;
 	}
 	
@@ -716,8 +843,13 @@
 		 */
 		stream->need_sync = false;
-		return fsync(stream->fd);
-	}
-	
-	return ENOENT;
+		if (fsync(stream->fd) != 0) {
+			/* errno was set by fsync() */
+			return EOF;
+		}
+
+		return 0;
+	}
+	
+	return 0;
 }
 
@@ -742,5 +874,5 @@
 	if (stream->kio) {
 		errno = EBADF;
-		return -1;
+		return EOF;
 	}
 	
@@ -748,9 +880,9 @@
 }
 
-async_sess_t *fsession(FILE *stream, iface_t iface)
+async_sess_t *vfs_fsession(FILE *stream, iface_t iface)
 {
 	if (stream->fd >= 0) {
 		if (stream->sess == NULL)
-			stream->sess = fd_session(stream->fd, iface);
+			stream->sess = vfs_fd_session(stream->fd, iface);
 		
 		return stream->sess;
@@ -760,5 +892,5 @@
 }
 
-int fhandle(FILE *stream, int *handle)
+int vfs_fhandle(FILE *stream, int *handle)
 {
 	if (stream->fd >= 0) {
Index: uspace/lib/c/generic/io/kio.c
===================================================================
--- uspace/lib/c/generic/io/kio.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/io/kio.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -43,12 +43,11 @@
 #include <io/printf_core.h>
 
-size_t kio_write(const void *buf, size_t size)
+int kio_write(const void *buf, size_t size, size_t *nwritten)
 {
-	ssize_t ret = (ssize_t) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size);
+	int rc = (int) __SYSCALL3(SYS_KIO, KIO_WRITE, (sysarg_t) buf, size);
 	
-	if (ret >= 0)
-		return (size_t) ret;
-	
-	return 0;
+	if (rc == EOK)
+		*nwritten = size;
+	return rc;
 }
 
@@ -84,5 +83,8 @@
 static int kio_vprintf_str_write(const char *str, size_t size, void *data)
 {
-	size_t wr = kio_write(str, size);
+	size_t wr;
+	
+	wr = 0;
+	(void) kio_write(str, size, &wr);
 	return str_nlength(str, wr);
 }
@@ -92,4 +94,5 @@
 	size_t offset = 0;
 	size_t chars = 0;
+	size_t wr;
 	
 	while (offset < size) {
@@ -98,5 +101,5 @@
 		
 		if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK)
-			kio_write(buf, sz);
+			kio_write(buf, sz, &wr);
 		
 		chars++;
Index: uspace/lib/c/generic/loader.c
===================================================================
--- uspace/lib/c/generic/loader.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/loader.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -124,5 +124,5 @@
 		return ENOMEM;
 	
-	if (!getcwd(cwd, MAX_PATH_LEN + 1))
+	if (getcwd(cwd, MAX_PATH_LEN + 1) == NULL)
 		str_cpy(cwd, MAX_PATH_LEN + 1, "/");
 	
@@ -162,5 +162,5 @@
 {
 	size_t pa_len;
-	char *pa = absolutize(path, &pa_len);
+	char *pa = vfs_absolutize(path, &pa_len);
 	if (!pa)
 		return ENOMEM;
Index: uspace/lib/c/generic/private/stdio.h
===================================================================
--- uspace/lib/c/generic/private/stdio.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/private/stdio.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -39,4 +39,7 @@
 #include <stdio.h>
 #include <async.h>
+
+/** Maximum characters that can be pushed back by ungetc() */
+#define UNGETC_MAX 1
 
 struct _IO_FILE {
@@ -82,4 +85,10 @@
 	/** Points to end of occupied space when in read mode. */
 	uint8_t *buf_tail;
+
+	/** Pushed back characters */
+	uint8_t ungetc_buf[UNGETC_MAX];
+
+	/** Number of pushed back characters */
+	int ungetc_chars;
 };
 
Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/task.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -112,15 +112,15 @@
 	int fd_stderr;
 	
-	if ((stdin != NULL) && (fhandle(stdin, &fd_stdin) == EOK))
+	if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK))
 		files[0] = &fd_stdin;
 	else
 		files[0] = NULL;
 	
-	if ((stdout != NULL) && (fhandle(stdout, &fd_stdout) == EOK))
+	if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK))
 		files[1] = &fd_stdout;
 	else
 		files[1] = NULL;
 	
-	if ((stderr != NULL) && (fhandle(stderr, &fd_stderr) == EOK))
+	if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK))
 		files[2] = &fd_stderr;
 	else
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -93,5 +93,5 @@
 }
 
-char *absolutize(const char *path, size_t *retlen)
+char *vfs_absolutize(const char *path, size_t *retlen)
 {
 	char *ncwd_path;
@@ -101,10 +101,10 @@
 	size_t size = str_size(path);
 	if (*path != '/') {
-		if (!cwd_path) {
+		if (cwd_path == NULL) {
 			fibril_mutex_unlock(&cwd_mutex);
 			return NULL;
 		}
 		ncwd_path_nc = malloc(cwd_size + 1 + size + 1);
-		if (!ncwd_path_nc) {
+		if (ncwd_path_nc == NULL) {
 			fibril_mutex_unlock(&cwd_mutex);
 			return NULL;
@@ -115,5 +115,5 @@
 	} else {
 		ncwd_path_nc = malloc(size + 1);
-		if (!ncwd_path_nc) {
+		if (ncwd_path_nc == NULL) {
 			fibril_mutex_unlock(&cwd_mutex);
 			return NULL;
@@ -123,5 +123,5 @@
 	str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path);
 	ncwd_path = canonify(ncwd_path_nc, retlen);
-	if (!ncwd_path) {
+	if (ncwd_path == NULL) {
 		fibril_mutex_unlock(&cwd_mutex);
 		free(ncwd_path_nc);
@@ -135,5 +135,5 @@
 	ncwd_path = str_dup(ncwd_path);
 	free(ncwd_path_nc);
-	if (!ncwd_path) {
+	if (ncwd_path == NULL) {
 		fibril_mutex_unlock(&cwd_mutex);
 		return NULL;
@@ -143,5 +143,5 @@
 }
 
-int mount(const char *fs_name, const char *mp, const char *fqsn,
+int vfs_mount(const char *fs_name, const char *mp, const char *fqsn,
     const char *opts, unsigned int flags, unsigned int instance)
 {
@@ -171,6 +171,6 @@
 	
 	size_t mpa_size;
-	char *mpa = absolutize(mp, &mpa_size);
-	if (!mpa) {
+	char *mpa = vfs_absolutize(mp, &mpa_size);
+	if (mpa == NULL) {
 		if (null_id != -1)
 			loc_null_destroy(null_id);
@@ -255,5 +255,5 @@
 }
 
-int unmount(const char *mp)
+int vfs_unmount(const char *mp)
 {
 	sysarg_t rc;
@@ -263,6 +263,6 @@
 	char *mpa;
 	
-	mpa = absolutize(mp, &mpa_size);
-	if (!mpa)
+	mpa = vfs_absolutize(mp, &mpa_size);
+	if (mpa == NULL)
 		return ENOMEM;
 	
@@ -289,5 +289,16 @@
 }
 
-static int open_internal(const char *abs, size_t abs_size, int lflag, int oflag)
+/** Open file (internal).
+ *
+ * @param abs Absolute path to file
+ * @param abs_size Size of @a abs string
+ * @param lflag L_xxx flags
+ * @param oflag O_xxx flags
+ * @param fd Place to store new file descriptor
+ *
+ * @return EOK on success, non-zero error code on error
+ */
+static int open_internal(const char *abs, size_t abs_size, int lflag, int oflag,
+    int *fd)
 {
 	async_exch_t *exch = vfs_exchange_begin();
@@ -315,20 +326,44 @@
 	    return (int) rc;
 	
-	return (int) IPC_GET_ARG1(answer);
-}
-
+	*fd = (int) IPC_GET_ARG1(answer);
+	return EOK;
+}
+
+/** Open file.
+ *
+ * @param path File path
+ * @param oflag O_xxx flags
+ * @param mode File mode (only with O_CREAT)
+ *
+ * @return Nonnegative file descriptor on success. On error -1 is returned
+ *         and errno is set.
+ */
 int open(const char *path, int oflag, ...)
 {
 	size_t abs_size;
-	char *abs = absolutize(path, &abs_size);
-	if (!abs)
-		return ENOMEM;
-	
-	int ret = open_internal(abs, abs_size, L_FILE, oflag);
+	char *abs = vfs_absolutize(path, &abs_size);
+	int fd = -1;
+	
+	if (abs == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+	
+	int rc = open_internal(abs, abs_size, L_FILE, oflag, &fd);
 	free(abs);
 	
-	return ret;
-}
-
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return fd;
+}
+
+/** Close file.
+ *
+ * @param fildes File descriptor
+ * @return Zero on success. On error -1 is returned and errno is set.
+ */
 int close(int fildes)
 {
@@ -339,8 +374,27 @@
 	vfs_exchange_end(exch);
 	
-	return (int) rc;
-}
-
-ssize_t read(int fildes, void *buf, size_t nbyte)
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return 0;
+}
+
+/** Read bytes from file.
+ *
+ * Read up to @a nbyte bytes from file. The actual number of bytes read
+ * may be lower, but greater than zero if there are any bytes available.
+ * If there are no bytes available for reading, then the function will
+ * return success with zero bytes read.
+ *
+ * @param fildes File descriptor
+ * @param buf Buffer
+ * @param nbyte Maximum number of bytes to read
+ * @param nread Place to store actual number of bytes read (0 or more)
+ *
+ * @return EOK on success, non-zero error code on error.
+ */
+static int _read_short(int fildes, void *buf, size_t nbyte, ssize_t *nread)
 {
 	sysarg_t rc;
@@ -357,22 +411,38 @@
 	if (rc != EOK) {
 		vfs_exchange_end(exch);
-
+		
 		sysarg_t rc_orig;
 		async_wait_for(req, &rc_orig);
-
+		
 		if (rc_orig == EOK)
-			return (ssize_t) rc;
+			return rc;
 		else
-			return (ssize_t) rc_orig;
-	}
+			return rc_orig;
+	}
+	
 	vfs_exchange_end(exch);
 	async_wait_for(req, &rc);
-	if (rc == EOK)
-		return (ssize_t) IPC_GET_ARG1(answer);
-	else
+	
+	if (rc != EOK)
 		return rc;
-}
-
-ssize_t write(int fildes, const void *buf, size_t nbyte) 
+	
+	*nread = (ssize_t) IPC_GET_ARG1(answer);
+	return EOK;
+}
+
+/** Write bytes to file.
+ *
+ * Write up to @a nbyte bytes from file. The actual number of bytes written
+ * may be lower, but greater than zero.
+ *
+ * @param fildes File descriptor
+ * @param buf Buffer
+ * @param nbyte Maximum number of bytes to write
+ * @param nread Place to store actual number of bytes written (0 or more)
+ *
+ * @return EOK on success, non-zero error code on error.
+ */
+static int _write_short(int fildes, const void *buf, size_t nbyte,
+    ssize_t *nwritten)
 {
 	sysarg_t rc;
@@ -389,25 +459,28 @@
 	if (rc != EOK) {
 		vfs_exchange_end(exch);
-
+		
 		sysarg_t rc_orig;
 		async_wait_for(req, &rc_orig);
-
+		
 		if (rc_orig == EOK)
-			return (ssize_t) rc;
+			return rc;
 		else
-			return (ssize_t) rc_orig;
-	}
+			return rc_orig;
+	}
+	
 	vfs_exchange_end(exch);
 	async_wait_for(req, &rc);
-	if (rc == EOK)
-		return (ssize_t) IPC_GET_ARG1(answer);
-	else
-		return -1;
-}
-
-/** Read entire buffer.
- *
- * In face of short reads this function continues reading until either
- * the entire buffer is read or no more data is available (at end of file).
+	
+	if (rc != EOK)
+		return rc;
+	
+	*nwritten = (ssize_t) IPC_GET_ARG1(answer);
+	return EOK;
+}
+
+/** Read data.
+ *
+ * Read up to @a nbytes bytes from file if available. This function always reads
+ * all the available bytes up to @a nbytes.
  *
  * @param fildes	File descriptor
@@ -415,26 +488,29 @@
  * @param nbytes	Number of bytes to read
  *
- * @return		On success, positive number of bytes read.
- *			On failure, negative error code from read().
- */
-ssize_t read_all(int fildes, void *buf, size_t nbyte)
+ * @return		On success, nonnegative number of bytes read.
+ *			On failure, -1 and sets errno.
+ */
+ssize_t read(int fildes, void *buf, size_t nbyte)
 {
 	ssize_t cnt = 0;
 	size_t nread = 0;
 	uint8_t *bp = (uint8_t *) buf;
-
+	int rc;
+	
 	do {
 		bp += cnt;
 		nread += cnt;
-		cnt = read(fildes, bp, nbyte - nread);
-	} while (cnt > 0 && (nbyte - nread - cnt) > 0);
-
-	if (cnt < 0)
-		return cnt;
-
+		rc = _read_short(fildes, bp, nbyte - nread, &cnt);
+	} while (rc == EOK && cnt > 0 && (nbyte - nread - cnt) > 0);
+	
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
 	return nread + cnt;
 }
 
-/** Write entire buffer.
+/** Write data.
  *
  * This function fails if it cannot write exactly @a len bytes to the file.
@@ -444,28 +520,33 @@
  * @param nbytes	Number of bytes to write
  *
- * @return		EOK on error, return value from write() if writing
- *			failed.
- */
-ssize_t write_all(int fildes, const void *buf, size_t nbyte)
+ * @return		On success, nonnegative number of bytes written.
+ *			On failure, -1 and sets errno.
+ */
+ssize_t write(int fildes, const void *buf, size_t nbyte)
 {
 	ssize_t cnt = 0;
 	ssize_t nwritten = 0;
 	const uint8_t *bp = (uint8_t *) buf;
+	int rc;
 
 	do {
 		bp += cnt;
 		nwritten += cnt;
-		cnt = write(fildes, bp, nbyte - nwritten);
-	} while (cnt > 0 && ((ssize_t )nbyte - nwritten - cnt) > 0);
-
-	if (cnt < 0)
-		return cnt;
-
-	if ((ssize_t)nbyte - nwritten - cnt > 0)
-		return EIO;
+		rc = _write_short(fildes, bp, nbyte - nwritten, &cnt);
+	} while (rc == EOK && ((ssize_t )nbyte - nwritten - cnt) > 0);
+
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
 
 	return nbyte;
 }
 
+/** Synchronize file.
+ *
+ * @param fildes File descriptor
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
 int fsync(int fildes)
 {
@@ -474,7 +555,21 @@
 	vfs_exchange_end(exch);
 	
-	return (int) rc;
-}
-
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return 0;
+}
+
+/** Seek to a position.
+ *
+ * @param fildes File descriptor
+ * @param offset Offset
+ * @param whence SEEK_SET, SEEK_CUR or SEEK_END
+ *
+ * @return On success the nonnegative offset from start of file. On error
+ *         returns (off64_t)-1 and sets errno.
+ */
 off64_t lseek(int fildes, off64_t offset, int whence)
 {
@@ -489,10 +584,21 @@
 	vfs_exchange_end(exch);
 	
-	if (rc != EOK)
+	if (rc != EOK) {
+		errno = rc;
 		return (off64_t) -1;
+	}
 	
 	return (off64_t) MERGE_LOUP32(newoff_lo, newoff_hi);
 }
 
+/** Truncate file to a specified length.
+ *
+ * Truncate file so that its size is exactly @a length
+ *
+ * @param fildes File descriptor
+ * @param length Length
+ *
+ * @return 0 on success, -1 on error and sets errno.
+ */
 int ftruncate(int fildes, aoff64_t length)
 {
@@ -504,7 +610,19 @@
 	vfs_exchange_end(exch);
 	
-	return (int) rc;
-}
-
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return 0;
+}
+
+/** Get file status.
+ *
+ * @param fildes File descriptor
+ * @param stat Place to store file information
+ *
+ * @return 0 on success, -1 on error and sets errno.
+ */
 int fstat(int fildes, struct stat *stat)
 {
@@ -518,19 +636,36 @@
 	if (rc != EOK) {
 		vfs_exchange_end(exch);
-
+		
 		sysarg_t rc_orig;
 		async_wait_for(req, &rc_orig);
-
-		if (rc_orig == EOK)
-			return (ssize_t) rc;
-		else
-			return (ssize_t) rc_orig;
-	}
+		
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
+		}
+		
+		return 0;
+	}
+	
 	vfs_exchange_end(exch);
 	async_wait_for(req, &rc);
-
-	return rc;
-}
-
+	
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return 0;
+}
+
+/** Get file status.
+ *
+ * @param path Path to file
+ * @param stat Place to store file information
+ *
+ * @return 0 on success, -1 on error and sets errno.
+ */
 int stat(const char *path, struct stat *stat)
 {
@@ -540,7 +675,9 @@
 	
 	size_t pa_size;
-	char *pa = absolutize(path, &pa_size);
-	if (!pa)
-		return ENOMEM;
+	char *pa = vfs_absolutize(path, &pa_size);
+	if (pa == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
 	
 	async_exch_t *exch = vfs_exchange_begin();
@@ -552,4 +689,195 @@
 		free(pa);
 		async_wait_for(req, &rc_orig);
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
+		}
+	}
+	rc = async_data_read_start(exch, stat, sizeof(struct stat));
+	if (rc != EOK) {
+		vfs_exchange_end(exch);
+		free(pa);
+		async_wait_for(req, &rc_orig);
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
+		}
+	}
+	vfs_exchange_end(exch);
+	free(pa);
+	async_wait_for(req, &rc);
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	return 0;
+}
+
+/** Open directory.
+ *
+ * @param dirname Directory pathname
+ *
+ * @return Non-NULL pointer on success. On error returns @c NULL and sets errno.
+ */
+DIR *opendir(const char *dirname)
+{
+	DIR *dirp = malloc(sizeof(DIR));
+	int fd = -1;
+	
+	if (dirp == NULL) {
+		errno = ENOMEM;
+		return NULL;
+	}
+	
+	size_t abs_size;
+	char *abs = vfs_absolutize(dirname, &abs_size);
+	if (abs == NULL) {
+		free(dirp);
+		errno = ENOMEM;
+		return NULL;
+	}
+	
+	int rc = open_internal(abs, abs_size, L_DIRECTORY, 0, &fd);
+	free(abs);
+	
+	if (rc != EOK) {
+		free(dirp);
+		errno = rc;
+		return NULL;
+	}
+	
+	dirp->fd = fd;
+	return dirp;
+}
+
+/** Read directory entry.
+ *
+ * @param dirp Open directory
+ * @return Non-NULL pointer to directory entry on success. On error returns
+ *         @c NULL and sets errno.
+ */
+struct dirent *readdir(DIR *dirp)
+{
+	int rc;
+	ssize_t len;
+	
+	rc = _read_short(dirp->fd, &dirp->res.d_name[0], NAME_MAX + 1, &len);
+	if (rc != EOK) {
+		errno = rc;
+		return NULL;
+	}
+	
+	(void) len;
+	return &dirp->res;
+}
+
+/** Rewind directory position to the beginning.
+ *
+ * @param dirp Open directory
+ */
+void rewinddir(DIR *dirp)
+{
+	(void) lseek(dirp->fd, 0, SEEK_SET);
+}
+
+/** Close directory.
+ *
+ * @param dirp Open directory
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
+int closedir(DIR *dirp)
+{
+	int rc;
+	
+	rc = close(dirp->fd);
+	free(dirp);
+
+	/* On error errno was set by close() */
+	return rc;
+}
+
+/** Create directory.
+ *
+ * @param path Path
+ * @param mode File mode
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
+int mkdir(const char *path, mode_t mode)
+{
+	sysarg_t rc;
+	aid_t req;
+	
+	size_t pa_size;
+	char *pa = vfs_absolutize(path, &pa_size);
+	if (pa == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+	
+	async_exch_t *exch = vfs_exchange_begin();
+	
+	req = async_send_1(exch, VFS_IN_MKDIR, mode, NULL);
+	rc = async_data_write_start(exch, pa, pa_size);
+	if (rc != EOK) {
+		vfs_exchange_end(exch);
+		free(pa);
+		
+		sysarg_t rc_orig;
+		async_wait_for(req, &rc_orig);
+		
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
+		}
+		
+		return 0;
+	}
+	
+	vfs_exchange_end(exch);
+	free(pa);
+	async_wait_for(req, &rc);
+	
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return 0;
+}
+
+/** Unlink a file or directory.
+ *
+ * @param path Path to file or empty directory
+ * @param lflag L_xxx flag (L_NONE, L_FILE or L_DIRECTORY)
+ * @return EOK on success, non-zero error code on error
+ */
+static int _unlink(const char *path, int lflag)
+{
+	sysarg_t rc;
+	aid_t req;
+	
+	size_t pa_size;
+	char *pa = vfs_absolutize(path, &pa_size);
+	if (pa == NULL)
+		return ENOMEM;
+	
+	async_exch_t *exch = vfs_exchange_begin();
+	
+	req = async_send_1(exch, VFS_IN_UNLINK, lflag, NULL);
+	rc = async_data_write_start(exch, pa, pa_size);
+	if (rc != EOK) {
+		vfs_exchange_end(exch);
+		free(pa);
+
+		sysarg_t rc_orig;
+		async_wait_for(req, &rc_orig);
+
 		if (rc_orig == EOK)
 			return (int) rc;
@@ -557,14 +885,4 @@
 			return (int) rc_orig;
 	}
-	rc = async_data_read_start(exch, stat, sizeof(struct stat));
-	if (rc != EOK) {
-		vfs_exchange_end(exch);
-		free(pa);
-		async_wait_for(req, &rc_orig);
-		if (rc_orig == EOK)
-			return (int) rc;
-		else
-			return (int) rc_orig;
-	}
 	vfs_exchange_end(exch);
 	free(pa);
@@ -573,123 +891,47 @@
 }
 
-DIR *opendir(const char *dirname)
-{
-	DIR *dirp = malloc(sizeof(DIR));
-	if (!dirp)
-		return NULL;
-	
-	size_t abs_size;
-	char *abs = absolutize(dirname, &abs_size);
-	if (!abs) {
-		free(dirp);
-		return NULL;
-	}
-	
-	int ret = open_internal(abs, abs_size, L_DIRECTORY, 0);
-	free(abs);
-	
-	if (ret < 0) {
-		free(dirp);
-		return NULL;
-	}
-	
-	dirp->fd = ret;
-	return dirp;
-}
-
-struct dirent *readdir(DIR *dirp)
-{
-	ssize_t len = read(dirp->fd, &dirp->res.d_name[0], NAME_MAX + 1);
-	if (len <= 0)
-		return NULL;
-	return &dirp->res;
-}
-
-void rewinddir(DIR *dirp)
-{
-	(void) lseek(dirp->fd, 0, SEEK_SET);
-}
-
-int closedir(DIR *dirp)
-{
-	(void) close(dirp->fd);
-	free(dirp);
+/** Unlink file or directory.
+ *
+ * @param path Path
+ * @return EOk on success, error code on error
+ */
+int unlink(const char *path)
+{
+	int rc;
+
+	rc = _unlink(path, L_NONE);
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+
 	return 0;
 }
 
-int mkdir(const char *path, mode_t mode)
-{
-	sysarg_t rc;
-	aid_t req;
-	
-	size_t pa_size;
-	char *pa = absolutize(path, &pa_size);
-	if (!pa)
-		return ENOMEM;
-	
-	async_exch_t *exch = vfs_exchange_begin();
-	
-	req = async_send_1(exch, VFS_IN_MKDIR, mode, NULL);
-	rc = async_data_write_start(exch, pa, pa_size);
-	if (rc != EOK) {
-		vfs_exchange_end(exch);
-		free(pa);
-
-		sysarg_t rc_orig;
-		async_wait_for(req, &rc_orig);
-
-		if (rc_orig == EOK)
-			return (int) rc;
-		else
-			return (int) rc_orig;
-	}
-	vfs_exchange_end(exch);
-	free(pa);
-	async_wait_for(req, &rc);
-	return rc;
-}
-
-static int _unlink(const char *path, int lflag)
-{
-	sysarg_t rc;
-	aid_t req;
-	
-	size_t pa_size;
-	char *pa = absolutize(path, &pa_size);
-	if (!pa)
-		return ENOMEM;
-	
-	async_exch_t *exch = vfs_exchange_begin();
-	
-	req = async_send_1(exch, VFS_IN_UNLINK, lflag, NULL);
-	rc = async_data_write_start(exch, pa, pa_size);
-	if (rc != EOK) {
-		vfs_exchange_end(exch);
-		free(pa);
-
-		sysarg_t rc_orig;
-		async_wait_for(req, &rc_orig);
-
-		if (rc_orig == EOK)
-			return (int) rc;
-		else
-			return (int) rc_orig;
-	}
-	vfs_exchange_end(exch);
-	free(pa);
-	async_wait_for(req, &rc);
-	return rc;
-}
-
-int unlink(const char *path)
-{
-	return _unlink(path, L_NONE);
-}
-
+/** Remove empty directory.
+ *
+ * @param path Path
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
 int rmdir(const char *path)
 {
-	return _unlink(path, L_DIRECTORY);
-}
-
+	int rc;
+
+	rc = _unlink(path, L_DIRECTORY);
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+
+	return 0;
+}
+
+/** Rename directory entry.
+ *
+ * @param old Old name
+ * @param new New name
+ *
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
 int rename(const char *old, const char *new)
 {
@@ -699,13 +941,16 @@
 	
 	size_t olda_size;
-	char *olda = absolutize(old, &olda_size);
-	if (!olda)
-		return ENOMEM;
+	char *olda = vfs_absolutize(old, &olda_size);
+	if (olda == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
 
 	size_t newa_size;
-	char *newa = absolutize(new, &newa_size);
-	if (!newa) {
+	char *newa = vfs_absolutize(new, &newa_size);
+	if (newa == NULL) {
 		free(olda);
-		return ENOMEM;
+		errno = ENOMEM;
+		return -1;
 	}
 	
@@ -719,8 +964,11 @@
 		free(newa);
 		async_wait_for(req, &rc_orig);
-		if (rc_orig == EOK)
-			return (int) rc;
-		else
-			return (int) rc_orig;
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
+		}
+		return 0;
 	}
 	rc = async_data_write_start(exch, newa, newa_size);
@@ -730,8 +978,11 @@
 		free(newa);
 		async_wait_for(req, &rc_orig);
-		if (rc_orig == EOK)
-			return (int) rc;
-		else
-			return (int) rc_orig;
+		if (rc_orig != EOK)
+			rc = rc_orig;
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
+		}
+		return 0;
 	}
 	vfs_exchange_end(exch);
@@ -739,7 +990,18 @@
 	free(newa);
 	async_wait_for(req, &rc);
-	return rc;
-}
-
+
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+
+	return 0;
+}
+
+/** Remove directory entry.
+ *
+ * @param path Path
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
 int remove(const char *path)
 {
@@ -747,16 +1009,26 @@
 }
 
+/** Change working directory.
+ *
+ * @param path Path
+ * @return 0 on success. On error returns -1 and sets errno.
+ */
 int chdir(const char *path)
 {
 	size_t abs_size;
-	char *abs = absolutize(path, &abs_size);
-	if (!abs)
-		return ENOMEM;
-	
-	int fd = open_internal(abs, abs_size, L_DIRECTORY, O_DESC);
-	
-	if (fd < 0) {
+	char *abs = vfs_absolutize(path, &abs_size);
+	int fd = -1;
+	
+	if (abs == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+	
+	int rc = open_internal(abs, abs_size, L_DIRECTORY, O_DESC, &fd);
+	
+	if (rc != EOK) {
 		free(abs);
-		return ENOENT;
+		errno = rc;
+		return -1;
 	}
 	
@@ -765,5 +1037,4 @@
 	if (cwd_fd >= 0)
 		close(cwd_fd);
-	
 	
 	if (cwd_path)
@@ -775,11 +1046,19 @@
 	
 	fibril_mutex_unlock(&cwd_mutex);
-	return EOK;
-}
-
+	return 0;
+}
+
+/** Get current working directory path.
+ *
+ * @param buf Buffer
+ * @param size Size of @a buf
+ * @return On success returns @a buf. On failure returns @c NULL and sets errno.
+ */
 char *getcwd(char *buf, size_t size)
 {
-	if (size == 0)
+	if (size == 0) {
+		errno = EINVAL;
 		return NULL;
+	}
 	
 	fibril_mutex_lock(&cwd_mutex);
@@ -787,4 +1066,5 @@
 	if ((cwd_size == 0) || (size < cwd_size + 1)) {
 		fibril_mutex_unlock(&cwd_mutex);
+		errno = ERANGE;
 		return NULL;
 	}
@@ -796,21 +1076,34 @@
 }
 
-async_sess_t *fd_session(int fildes, iface_t iface)
+/** Open session to service represented by a special file.
+ *
+ * Given that the file referred to by @a fildes represents a service,
+ * open a session to that service.
+ *
+ * @param fildes File descriptor
+ * @param iface Interface to connect to (XXX Should be automatic)
+ * @return On success returns session pointer. On error returns @c NULL.
+ */
+async_sess_t *vfs_fd_session(int fildes, iface_t iface)
 {
 	struct stat stat;
 	int rc = fstat(fildes, &stat);
-	if (rc != 0) {
-		errno = rc;
+	if (rc != 0)
 		return NULL;
-	}
-	
-	if (!stat.service) {
-		errno = ENOENT;
+	
+	if (stat.service == 0)
 		return NULL;
-	}
 	
 	return loc_service_connect(stat.service, iface, 0);
 }
 
+/** Duplicate open file.
+ *
+ * Duplicate open file under a new file descriptor.
+ *
+ * @param oldfd Old file descriptor
+ * @param newfd New file descriptor
+ * @return 0 on success. On error -1 is returned and errno is set
+ */
 int dup2(int oldfd, int newfd)
 {
@@ -823,10 +1116,15 @@
 	
 	if (rc == EOK)
-		return (int) ret;
-	
-	return (int) rc;
-}
-
-int fd_wait(void)
+		rc = ret;
+	
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+	
+	return 0;
+}
+
+int vfs_fd_wait(void)
 {
 	async_exch_t *exch = vfs_exchange_begin();
@@ -843,5 +1141,5 @@
 }
 
-int get_mtab_list(list_t *mtab_list)
+int vfs_get_mtab_list(list_t *mtab_list)
 {
 	sysarg_t rc;
@@ -863,5 +1161,5 @@
 
 		mtab_ent = malloc(sizeof(mtab_ent_t));
-		if (!mtab_ent) {
+		if (mtab_ent == NULL) {
 			rc = ENOMEM;
 			goto exit;
@@ -904,4 +1202,10 @@
 }
 
+/** Get filesystem statistics.
+ *
+ * @param path Mount point path
+ * @param st Buffer for storing information
+ * @return 0 on success. On error -1 is returned and errno is set.
+ */
 int statfs(const char *path, struct statfs *st)
 {
@@ -910,7 +1214,9 @@
 	size_t pa_size;
 
-	char *pa = absolutize(path, &pa_size);
-	if (!pa)
-		return ENOMEM;
+	char *pa = vfs_absolutize(path, &pa_size);
+	if (pa == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
 
 	async_exch_t *exch = vfs_exchange_begin();
@@ -927,5 +1233,12 @@
 	free(pa);
 	async_wait_for(req, &rc_orig);
-	return (int) (rc_orig != EOK ? rc_orig : rc);
+	rc = (rc_orig != EOK ? rc_orig : rc);
+
+	if (rc != EOK) {
+		errno = rc;
+		return -1;
+	}
+
+	return 0;
 }
 
Index: pace/lib/c/include/cfg.h
===================================================================
--- uspace/lib/c/include/cfg.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ 	(revision )
@@ -1,104 +1,0 @@
-/*
- * Copyright (c) 2011 Radim Vansa
- * 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 cfg.h
- * @brief Simple interface for configuration files manipulation.
- */
-
-#ifndef LIBC_CFG_H_
-#define LIBC_CFG_H_
-
-#include <adt/list.h>
-#include <sys/types.h>
-#include <stdbool.h>
-
-/**
- * One key-value pair
- */
-typedef struct {
-	link_t link;
-	
-	const char *key;
-	const char *value;
-} cfg_entry_t;
-
-/**
- * One section in the configuration file.
- * Has own title (or is anonymous) and contains entries.
- */
-typedef struct {
-	link_t link;
-	
-	const char *title;
-	list_t entries;
-	size_t entry_count;
-} cfg_section_t;
-
-/**
- * The configuration file data. The whole file is loaded
- * into memory and strings in sections (titles) or entries
- * (keys and values) are only pointers to this memory.
- * Therefore all the text data are allocated and deallocated
- * only once, if you want to use the strings after unloading
- * the configuration file, you have to copy them.
- */
-typedef struct {
-	list_t sections;
-	size_t section_count;
-	const char *data;
-} cfg_file_t;
-
-#define cfg_file_foreach(file, cur) \
-	list_foreach((file)->sections, link, const cfg_section_t, (cur))
-
-#define cfg_section_instance(cur) \
-	list_get_instance((cur), const cfg_section_t, link)
-
-#define cfg_section_foreach(section, cur) \
-	list_foreach((section)->entries, link, const cfg_entry_t, (cur))
-
-#define cfg_entry_instance(cur) \
-	list_get_instance((cur), const cfg_entry_t, link)
-
-extern int cfg_load(const char *, cfg_file_t *);
-extern int cfg_load_path(const char *, const char *, cfg_file_t *);
-extern void cfg_unload(cfg_file_t *);
-extern bool cfg_empty(const cfg_file_t *);
-extern const cfg_section_t *cfg_find_section(const cfg_file_t *, const char *);
-extern const char *cfg_find_value(const cfg_section_t *, const char *);
-extern const cfg_section_t *cfg_anonymous(const cfg_file_t *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/errno.h
===================================================================
--- uspace/lib/c/include/errno.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/errno.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -47,12 +47,12 @@
 #define ENOTDIR       (-258)
 #define ENOSPC        (-259)
-#define EEXIST        (-260)
 #define ENOTEMPTY     (-261)
 #define EBADF         (-262)
-#define ERANGE        (-263)
-#define EXDEV         (-264)
-#define EIO           (-265)
-#define EMLINK        (-266)
-#define ENXIO         (-267)
+#define EDOM          (-263)
+#define ERANGE        (-264)
+#define EXDEV         (-265)
+#define EIO           (-266)
+#define EMLINK        (-267)
+#define ENXIO         (-268)
 
 /** Bad checksum. */
Index: uspace/lib/c/include/io/kio.h
===================================================================
--- uspace/lib/c/include/io/kio.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/io/kio.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -40,5 +40,5 @@
 #include <io/verify.h>
 
-extern size_t kio_write(const void *, size_t);
+extern int kio_write(const void *, size_t, size_t *);
 extern void kio_update(void);
 extern void kio_command(const void *, size_t);
Index: uspace/lib/c/include/stdint.h
===================================================================
--- uspace/lib/c/include/stdint.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -60,5 +60,5 @@
 #define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
 
-#include <libarch/types.h>
+#include <libarch/stdint.h>
 
 /* off64_t */
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/stdio.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -109,4 +109,6 @@
 extern int puts(const char *);
 
+extern int ungetc(int, FILE *);
+
 /* Formatted string output functions */
 extern int fprintf(FILE *, const char*, ...)
@@ -132,4 +134,5 @@
 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 *);
 
Index: uspace/lib/c/include/sys/statfs.h
===================================================================
--- uspace/lib/c/include/sys/statfs.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/sys/statfs.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -46,4 +46,5 @@
 
 extern int statfs(const char *, struct statfs *);
+
 #endif
 
Index: uspace/lib/c/include/unistd.h
===================================================================
--- uspace/lib/c/include/unistd.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/unistd.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -63,7 +63,4 @@
 extern ssize_t read(int, void *, size_t);
 
-extern ssize_t read_all(int, void *, size_t);
-extern ssize_t write_all(int, const void *, size_t);
-
 extern off64_t lseek(int, off64_t, int);
 extern int ftruncate(int, aoff64_t);
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/vfs/vfs.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -50,17 +50,18 @@
 
 
-extern char *absolutize(const char *, size_t *);
+extern char *vfs_absolutize(const char *, size_t *);
 
-extern int mount(const char *, const char *, const char *, const char *,
+extern int vfs_mount(const char *, const char *, const char *, const char *,
     unsigned int, unsigned int);
-extern int unmount(const char *);
+extern int vfs_unmount(const char *);
 
-extern int fhandle(FILE *, int *);
+extern int vfs_fhandle(FILE *, int *);
 
-extern int fd_wait(void);
-extern int get_mtab_list(list_t *mtab_list);
+extern int vfs_fd_wait(void);
+extern int vfs_get_mtab_list(list_t *mtab_list);
 
 extern async_exch_t *vfs_exchange_begin(void);
 extern void vfs_exchange_end(async_exch_t *);
+
 #endif
 
Index: uspace/lib/c/include/vfs/vfs_sess.h
===================================================================
--- uspace/lib/c/include/vfs/vfs_sess.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/c/include/vfs/vfs_sess.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -39,6 +39,6 @@
 #include <stdio.h>
 
-extern async_sess_t *fd_session(int, iface_t);
-extern async_sess_t *fsession(FILE *, iface_t);
+extern async_sess_t *vfs_fd_session(int, iface_t);
+extern async_sess_t *vfs_fsession(FILE *, iface_t);
 
 #endif
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/drv/generic/driver.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -945,5 +945,5 @@
 	if (rc != EOK) {
 		printf("Error: Failed to register driver with device manager "
-		    "(%s).\n", (rc == EEXISTS) ? "driver already started" :
+		    "(%s).\n", (rc == EEXIST) ? "driver already started" :
 		    str_error(rc));
 		
Index: uspace/lib/ext4/libext4_ialloc.c
===================================================================
--- uspace/lib/ext4/libext4_ialloc.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/ext4/libext4_ialloc.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -195,6 +195,18 @@
 		uint32_t used_dirs = ext4_block_group_get_used_dirs_count(bg, sb);
 		
-		/* Check if this block group is good candidate for allocation */
-		if ((free_inodes >= avg_free_inodes) && (free_blocks > 0)) {
+		/*
+		 * Check if this block group is a good candidate
+		 * for allocation.
+		 *
+		 * The criterion is based on the average number
+		 * of free inodes, unless we examine the last block
+		 * group. In that case the last block group might
+		 * have less than the average number of free inodes,
+		 * but it still needs to be taken as a candidate
+		 * because the previous block groups have zero free
+		 * blocks.
+		 */
+		if (((free_inodes >= avg_free_inodes) || (bgid == bg_count - 1)) &&
+		    (free_blocks > 0)) {
 			/* Load block with bitmap */
 			uint32_t bitmap_block_addr = ext4_block_group_get_inode_bitmap(
Index: uspace/lib/math/Makefile
===================================================================
--- uspace/lib/math/Makefile	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/Makefile	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -41,11 +41,25 @@
 
 GENERIC_SOURCES = \
+	generic/acos.c \
+	generic/asin.c \
+	generic/atan.c \
+	generic/atan2.c \
 	generic/ceil.c \
+	generic/cosh.c \
 	generic/exp.c \
+	generic/fabs.c \
 	generic/floor.c \
+	generic/fmod.c \
+	generic/frexp.c \
+	generic/ldexp.c \
 	generic/log.c \
+	generic/log10.c \
+	generic/modf.c \
+	generic/pow.c \
+	generic/sinh.c \
+	generic/sqrt.c \
+	generic/tan.c \
+	generic/tanh.c \
 	generic/trig.c \
-	generic/pow.c \
-	generic/mod.c \
 	generic/trunc.c
 
Index: uspace/lib/math/arch/abs32le/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/abs32le/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/abs32le/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_abs32le_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/amd64/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/amd64/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/amd64/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_amd64_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -64,4 +120,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -74,4 +140,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -83,13 +159,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -104,4 +199,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -121,4 +236,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 extern float64_t trunc_f64(float64_t);
 
@@ -128,4 +283,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -148,4 +343,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -158,4 +363,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -178,4 +393,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -188,4 +423,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -206,4 +461,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/arm32/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/arm32/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/arm32/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_arm32_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/ia32/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/ia32/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/ia32/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_ia32_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -64,4 +120,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -74,4 +140,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -83,13 +159,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -104,4 +199,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -121,4 +236,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 extern float64_t trunc_f64(float64_t);
 
@@ -128,4 +283,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -148,4 +343,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -158,4 +363,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -178,4 +393,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -188,4 +423,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -206,4 +461,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/ia64/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/ia64/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/ia64/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_ia64_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/mips32/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/mips32/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/mips32/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_mips32_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/mips32eb/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/mips32eb/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/mips32eb/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_mips32eb_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/ppc32/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/ppc32/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/ppc32/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_ppc32_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/sparc32/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/sparc32/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/sparc32/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_sparc32_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/arch/sparc64/include/libarch/math.h
===================================================================
--- uspace/lib/math/arch/sparc64/include/libarch/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/arch/sparc64/include/libarch/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -37,13 +37,69 @@
 #define LIBMATH_sparc64_MATH_H_
 
+#include <acos.h>
+#include <asin.h>
+#include <atan.h>
+#include <atan2.h>
 #include <ceil.h>
+#include <cosh.h>
 #include <exp.h>
+#include <fabs.h>
 #include <floor.h>
+#include <fmod.h>
+#include <frexp.h>
+#include <ldexp.h>
 #include <log.h>
+#include <log10.h>
 #include <mathtypes.h>
-#include <mod.h>
+#include <modf.h>
 #include <pow.h>
+#include <sinh.h>
+#include <sqrt.h>
+#include <tan.h>
+#include <tanh.h>
+#include <trig.h>
 #include <trunc.h>
-#include <trig.h>
+
+#define HUGE_VAL FLOAT64_INF
+
+static inline float64_t acos_f64(float64_t val)
+{
+	return float64_acos(val);
+}
+
+static inline float32_t acos_f32(float32_t val)
+{
+	return float32_acos(val);
+}
+
+static inline float64_t asin_f64(float64_t val)
+{
+	return float64_asin(val);
+}
+
+static inline float32_t asin_f32(float32_t val)
+{
+	return float32_asin(val);
+}
+
+static inline float64_t atan_f64(float64_t val)
+{
+	return float64_atan(val);
+}
+
+static inline float32_t atan_f32(float32_t val)
+{
+	return float32_atan(val);
+}
+
+static inline float64_t atan2_f64(float64_t y, float64_t x)
+{
+	return float64_atan2(y, x);
+}
+
+static inline float32_t atan2_f32(float32_t y, float32_t x)
+{
+	return float32_atan2(y, x);
+}
 
 static inline float64_t ceil_f64(float64_t val)
@@ -67,4 +123,14 @@
 }
 
+static inline float64_t cosh_f64(float64_t val)
+{
+	return float64_cosh(val);
+}
+
+static inline float32_t cosh_f32(float32_t val)
+{
+	return float32_cosh(val);
+}
+
 static inline float64_t exp_f64(float64_t val)
 {
@@ -77,4 +143,14 @@
 }
 
+static inline float64_t fabs_f64(float64_t val)
+{
+	return float64_fabs(val);
+}
+
+static inline float32_t fabs_f32(float32_t val)
+{
+	return float32_fabs(val);
+}
+
 static inline float64_t floor_f64(float64_t val)
 {
@@ -86,13 +162,32 @@
 	return float32_floor(val);
 }
-
 static inline float64_t fmod_f64(float64_t dividend, float64_t divisor)
 {
-	return float64_mod(dividend, divisor);
+	return float64_fmod(dividend, divisor);
 }
 
 static inline float64_t fmod_f32(float32_t dividend, float32_t divisor)
 {
-	return float32_mod(dividend, divisor);
+	return float32_fmod(dividend, divisor);
+}
+
+static inline float64_t frexp_f64(float64_t x, int *exp)
+{
+	return float64_frexp(x, exp);
+}
+
+static inline float64_t frexp_f32(float32_t x, int *exp)
+{
+	return float32_frexp(x, exp);
+}
+
+static inline float64_t ldexp_f64(float64_t x, int exp)
+{
+	return float64_ldexp(x, exp);
+}
+
+static inline float64_t ldexp_f32(float32_t x, int exp)
+{
+	return float32_ldexp(x, exp);
 }
 
@@ -107,4 +202,24 @@
 }
 
+static inline float64_t log10_f64(float64_t val)
+{
+	return float64_log10(val);
+}
+
+static inline float32_t log10_f32(float32_t val)
+{
+	return float32_log10(val);
+}
+
+static inline float64_t modf_f64(float64_t value, float64_t *iptr)
+{
+	return float64_modf(value, iptr);
+}
+
+static inline float64_t modf_f32(float32_t value, float32_t *iptr)
+{
+	return float32_modf(value, iptr);
+}
+
 static inline float64_t pow_f64(float64_t x, float64_t y)
 {
@@ -127,4 +242,44 @@
 }
 
+static inline float64_t sinh_f64(float64_t val)
+{
+	return float64_sinh(val);
+}
+
+static inline float32_t sinh_f32(float32_t val)
+{
+	return float32_sinh(val);
+}
+
+static inline float64_t sqrt_f64(float64_t val)
+{
+	return float64_sqrt(val);
+}
+
+static inline float32_t sqrt_f32(float32_t val)
+{
+	return float32_sqrt(val);
+}
+
+static inline float64_t tan_f64(float64_t val)
+{
+	return float64_tan(val);
+}
+
+static inline float32_t tan_f32(float32_t val)
+{
+	return float32_tan(val);
+}
+
+static inline float64_t tanh_f64(float64_t val)
+{
+	return float64_tanh(val);
+}
+
+static inline float32_t tanh_f32(float32_t val)
+{
+	return float32_tanh(val);
+}
+
 static inline float64_t trunc_f64(float64_t val)
 {
@@ -137,4 +292,44 @@
 }
 
+static inline float64_t acos(float64_t val)
+{
+	return acos_f64(val);
+}
+
+static inline float32_t acosf(float32_t val)
+{
+	return acos_f32(val);
+}
+
+static inline float64_t asin(float64_t val)
+{
+	return asin_f64(val);
+}
+
+static inline float32_t asinf(float32_t val)
+{
+	return asin_f32(val);
+}
+
+static inline float64_t atan(float64_t val)
+{
+	return atan_f64(val);
+}
+
+static inline float32_t atanf(float32_t val)
+{
+	return atan_f32(val);
+}
+
+static inline float64_t atan2(float64_t y, float64_t x)
+{
+	return atan2_f64(y, x);
+}
+
+static inline float32_t atan2f(float32_t y, float32_t x)
+{
+	return atan2_f32(y, x);
+}
+
 static inline float64_t ceil(float64_t val)
 {
@@ -157,4 +352,14 @@
 }
 
+static inline float64_t cosh(float64_t val)
+{
+	return cosh_f64(val);
+}
+
+static inline float32_t coshf(float32_t val)
+{
+	return cosh_f32(val);
+}
+
 static inline float64_t exp(float64_t val)
 {
@@ -167,4 +372,14 @@
 }
 
+static inline float64_t fabs(float64_t val)
+{
+	return fabs_f64(val);
+}
+
+static inline float32_t fabsf(float32_t val)
+{
+	return fabs_f32(val);
+}
+
 static inline float64_t floor(float64_t val)
 {
@@ -187,4 +402,24 @@
 }
 
+static inline float64_t frexp(float64_t x, int *exp)
+{
+	return frexp_f64(x, exp);
+}
+
+static inline float32_t frexpf(float32_t x, int *exp)
+{
+	return frexp_f32(x, exp);
+}
+
+static inline float64_t ldexp(float64_t x, int exp)
+{
+	return ldexp_f64(x, exp);
+}
+
+static inline float32_t ldexpf(float32_t x, int exp)
+{
+	return ldexp_f32(x, exp);
+}
+
 static inline float64_t log(float64_t val)
 {
@@ -197,4 +432,24 @@
 }
 
+static inline float64_t log10(float64_t val)
+{
+	return log10_f64(val);
+}
+
+static inline float32_t log10f(float32_t val)
+{
+	return log10_f32(val);
+}
+
+static inline float64_t modf(float64_t value, float64_t *iptr)
+{
+	return modf_f64(value, iptr);
+}
+
+static inline float32_t modff(float32_t value, float32_t *iptr)
+{
+	return modf_f32(value, iptr);
+}
+
 static inline float64_t pow(float64_t x, float64_t y)
 {
@@ -215,4 +470,44 @@
 {
 	return sin_f32(val);
+}
+
+static inline float64_t sinh(float64_t val)
+{
+	return sinh_f64(val);
+}
+
+static inline float32_t sinhf(float32_t val)
+{
+	return sinh_f32(val);
+}
+
+static inline float64_t sqrt(float64_t val)
+{
+	return sqrt_f64(val);
+}
+
+static inline float32_t sqrtf(float32_t val)
+{
+	return sqrt_f32(val);
+}
+
+static inline float64_t tan(float64_t val)
+{
+	return tan_f64(val);
+}
+
+static inline float32_t tanf(float32_t val)
+{
+	return tan_f32(val);
+}
+
+static inline float64_t tanh(float64_t val)
+{
+	return tanh_f64(val);
+}
+
+static inline float32_t tanhf(float32_t val)
+{
+	return tanh_f32(val);
 }
 
Index: uspace/lib/math/generic/acos.c
===================================================================
--- uspace/lib/math/generic/acos.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/acos.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <acos.h>
+#include <errno.h>
+#include <math.h>
+
+/** Inverse cosine (32-bit floating point)
+ *
+ * Compute inverse cosine value.
+ *
+ * @param arg Inversecosine argument.
+ *
+ * @return Inverse cosine value.
+ *
+ */
+float32_t float32_acos(float32_t arg)
+{
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT32_NAN;
+	}
+
+	return M_PI_2 - asin_f32(arg);
+}
+
+/** Inverse cosine (64-bit floating point)
+ *
+ * Compute inverse cosine value.
+ *
+ * @param arg Inversecosine argument.
+ *
+ * @return Inverse cosine value.
+ *
+ */
+float64_t float64_acos(float64_t arg)
+{
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT64_NAN;
+	}
+
+	return M_PI_2 - asin_f64(arg);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/asin.c
===================================================================
--- uspace/lib/math/generic/asin.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/asin.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <asin.h>
+#include <errno.h>
+#include <math.h>
+
+/** Inverse sine (32-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float32_t float32_asin(float32_t arg)
+{
+	float32_t aval;
+	
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT32_NAN;
+	}
+	
+	aval = 2.0 * atan_f32(arg / (1.0 + sqrt_f32(1.0 - arg*arg)));
+	if (arg > 0.0)
+		return aval;
+	else
+		return -aval;
+}
+
+/** Inverse sine (64-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float64_t float64_asin(float64_t arg)
+{
+	float64_t aval;
+	
+	if (arg < -1.0 || arg > 1.0) {
+		errno = EDOM;
+		return FLOAT64_NAN;
+	}
+	
+	aval = 2.0 * atan_f64(arg / (1.0 + sqrt_f64(1.0 - arg*arg)));
+	if (arg > 0.0)
+		return aval;
+	else
+		return -aval;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/atan.c
===================================================================
--- uspace/lib/math/generic/atan.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/atan.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <atan.h>
+#include <errno.h>
+#include <math.h>
+
+#define SERIES_DEGREE_32 13
+#define SERIES_DEGREE_64 33
+
+/** Inverse tangent approximation by Euler's series (32-bit floating point)
+ *
+ * Compute the approximation of inverse tangent by a
+ * series found by Leonhard Euler (using the first SERIES_DEGREE terms).
+ *
+ * @param arg Inverse tangent argument.
+ *
+ * @return Inverse tangent value approximation.
+ *
+ */
+static float32_t series_atan_32(float32_t arg)
+{
+	float32_t sum = 0;
+	float32_t a = arg / (1.0 + arg * arg);
+	
+	/*
+	 * atan(z) = sum(n=0, +inf) [ (2^2n) * (n!)^2 / (2n + 1)! *
+	 *    z^(2n+1) / (1 + z^2)^(n+1) ]
+	 */
+	
+	for (unsigned int n = 0; n < SERIES_DEGREE_32; n++) {
+		if (n > 0) {
+			a = a * n * n;
+			a = a / (2.0 * n + 1.0) / (2.0 * n);
+		}
+		sum += a;
+		a = a * 4.0 * arg * arg / (1.0 + arg * arg);
+	}
+	
+	return sum;
+}
+
+/** Inverse tangent approximation by Euler's series (64-bit floating point)
+ *
+ * Compute the approximation of inverse tangent by a
+ * series found by Leonhard Euler (using the first SERIES_DEGREE terms).
+ *
+ * @param arg Inverse tangent argument.
+ *
+ * @return Inverse tangent value approximation.
+ *
+ */
+static float64_t series_atan_64(float64_t arg)
+{
+	float64_t sum = 0;
+	float64_t a = arg / (1.0 + arg * arg);
+	
+	/*
+	 * atan(z) = sum(n=0, +inf) [ (2^2n) * (n!)^2 / (2n + 1)! *
+	 *    z^(2n+1) / (1 + z^2)^(n+1) ]
+	 */
+	
+	for (unsigned int n = 0; n < SERIES_DEGREE_64; n++) {
+		if (n > 0) {
+			a = a * n * n;
+			a = a / (2.0 * n + 1.0) / (2.0 * n);
+		}
+		sum += a;
+		a = a * 4.0 * arg * arg / (1.0 + arg * arg);
+	}
+	
+	return sum;
+}
+
+/** Inverse tangent (32-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float32_t float32_atan(float32_t arg)
+{
+	if (arg < -1.0 || arg > 1.0)
+		return 2.0 * series_atan_32(arg / (1.0 + sqrt_f32(1.0 + arg*arg)));
+	else
+		return series_atan_32(arg);
+}
+
+/** Inverse tangent (64-bit floating point)
+ *
+ * Compute inverse sine value.
+ *
+ * @param arg Inverse sine argument.
+ *
+ * @return Inverse sine value.
+ *
+ */
+float64_t float64_atan(float64_t arg)
+{
+	if (arg < -1.0 || arg > 1.0)
+		return 2.0 * series_atan_64(arg / (1.0 + sqrt_f64(1.0 + arg*arg)));
+	else
+		return series_atan_64(arg);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/atan2.c
===================================================================
--- uspace/lib/math/generic/atan2.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/atan2.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <atan2.h>
+#include <errno.h>
+#include <math.h>
+
+/** Inverse tangent of two variables (32-bit floating point)
+ *
+ * @param y
+ * @param x
+ *
+ * @return Inverse tangent of @a y / @a x.
+ *
+ */
+float32_t float32_atan2(float32_t y, float32_t x)
+{
+	if (x >= 0)
+		return atan_f32(y / x);
+	else if (y >= 0)
+		return M_PI - atan_f32(y / -x);
+	else
+		return -M_PI + atan_f32(y / -x);
+}
+
+/** Inverse tangent of two variables (64-bit floating point)
+ *
+ * @param y
+ * @param x
+ *
+ * @return Inverse tangent of @a y / @a x.
+ *
+ */
+float64_t float64_atan2(float64_t y, float64_t x)
+{
+	if (x >= 0)
+		return atan_f64(y / x);
+	else if (y >= 0)
+		return M_PI - atan_f64(y / -x);
+	else
+		return -M_PI + atan_f64(y / -x);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/cosh.c
===================================================================
--- uspace/lib/math/generic/cosh.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/cosh.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <cosh.h>
+#include <math.h>
+
+/** Hyperbolic cosine (32-bit floating point)
+ *
+ * Compute hyperbolic cosine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic cosine.
+ *
+ */
+float32_t float32_cosh(float32_t arg)
+{
+	return (exp_f32(arg) + exp_f32(-arg)) / 2.0;
+}
+
+/** Hyperbolic cosine (64-bit floating point)
+ *
+ * Compute hyperbolic cosine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic cosine.
+ *
+ */
+float64_t float64_cosh(float64_t arg)
+{
+	return (exp_f64(arg) + exp_f64(-arg)) / 2.0;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/exp.c
===================================================================
--- uspace/lib/math/generic/exp.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/generic/exp.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -36,5 +36,4 @@
 #include <exp.h>
 #include <math.h>
-#include <trunc.h>
 
 #define TAYLOR_DEGREE_32 13
Index: uspace/lib/math/generic/fabs.c
===================================================================
--- uspace/lib/math/generic/fabs.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/fabs.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <fabs.h>
+
+/** Absolute value (32-bit floating point)
+ *
+ * Compute absolute value.
+ *
+ * @param arg Argument.
+ *
+ * @return Absolute value.
+ *
+ */
+float32_t float32_fabs(float32_t arg)
+{
+	if (arg < 0.0)
+		return -arg;
+	else
+		return arg;
+}
+
+/** Absolute value (64-bit floating point)
+ *
+ * Compute absolute value.
+ *
+ * @param arg Argument.
+ *
+ * @return Absolute value.
+ *
+ */
+float64_t float64_fabs(float64_t arg)
+{
+	if (arg < 0.0)
+		return -arg;
+	else
+		return arg;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/fmod.c
===================================================================
--- uspace/lib/math/generic/fmod.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/fmod.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014 Martin Decky
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <fmod.h>
+#include <math.h>
+
+/** Remainder function (32-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float32_t float32_fmod(float32_t dividend, float32_t divisor)
+{
+	// FIXME: replace with exact arithmetics
+	
+	float32_t quotient = trunc_f32(dividend / divisor);
+	
+	return (dividend - quotient * divisor);
+}
+
+/** Remainder function (64-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float64_t float64_fmod(float64_t dividend, float64_t divisor)
+{
+	// FIXME: replace with exact arithmetics
+	
+	float64_t quotient = trunc_f64(dividend / divisor);
+	
+	return (dividend - quotient * divisor);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/frexp.c
===================================================================
--- uspace/lib/math/generic/frexp.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/frexp.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <frexp.h>
+#include <math.h>
+
+/** Break single precision number into fraction and exponent
+ *
+ * Return f and *exp such that x = f * 2^(*exp) and f is in [0.5,1)
+ *
+ * @param x Number
+ * @param exp Place to store exponent
+ *
+ * @return f
+ *
+ */
+float32_t float32_frexp(float32_t x, int *exp)
+{
+	float32_u u;
+
+	u.val = x;
+	*exp = u.data.parts.exp - FLOAT32_BIAS;
+	u.data.parts.exp = FLOAT32_BIAS;
+
+	return u.val;
+}
+
+/** Break double precision number into fraction and exponent
+ *
+ * Return f and *exp such that x = f * 2^(*exp) and f is in [0.5,1)
+ *
+ * @param x Number
+ * @param exp Place to store exponent
+ *
+ * @return f
+ *
+ */
+float64_t float64_frexp(float64_t x, int *exp)
+{
+	float64_u u;
+
+	u.val = x;
+	*exp = u.data.parts.exp - FLOAT64_BIAS;
+	u.data.parts.exp = FLOAT64_BIAS;
+
+	return u.val;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/ldexp.c
===================================================================
--- uspace/lib/math/generic/ldexp.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/ldexp.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <errno.h>
+#include <ldexp.h>
+#include <math.h>
+
+/** Single precision multiply by power of two
+ *
+ * Compute x * 2^exp.
+ *
+ * @param x Number
+ * @param exp Exponent
+ *
+ * @return x * 2^exp
+ *
+ */
+float32_t float32_ldexp(float32_t x, int exp)
+{
+	float32_u u;
+	int e;
+
+	u.val = x;
+	e = u.data.parts.exp + exp;
+
+	if (e < 0) {
+		/* XXX Can we return denormalized numbers? */
+		return 0.0;
+	} else if (e > FLOAT32_MAX_EXPONENT) {
+		errno = ERANGE;
+		if (e < 0)
+			return -FLOAT32_INF;
+		else
+			return FLOAT32_INF;
+	} else {
+		/* Adjust exponent */
+		u.data.parts.exp = e;
+		return u.val;
+	}
+}
+
+/** Double precision multiply by power of two
+ *
+ * Compute x * 2^exp.
+ *
+ * @param x Number
+ * @param y Exponent
+ *
+ * @return x * 2^exp
+ *
+ */
+float64_t float64_ldexp(float64_t x, int exp)
+{
+	float64_u u;
+	int e;
+
+	u.val = x;
+	e = u.data.parts.exp + exp;
+
+	if (e < 0) {
+		/* XXX Can we return denormalized numbers? */
+		return 0.0;
+	} else if (e > FLOAT64_MAX_EXPONENT) {
+		errno = ERANGE;
+		if (e < 0)
+			return -FLOAT64_INF;
+		else
+			return FLOAT64_INF;
+	} else {
+		/* Adjust exponent */
+		u.data.parts.exp = e;
+		return u.val;
+	}
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/log10.c
===================================================================
--- uspace/lib/math/generic/log10.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/log10.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <log10.h>
+#include <math.h>
+
+/** Decimal logarithm (32-bit floating point)
+ *
+ * Compute logarithm value.
+ *
+ * @param arg Logarithm argument.
+ *
+ * @return Logarithm value.
+ *
+ */
+float32_t float32_log10(float32_t arg)
+{
+	return log_f32(arg) / M_LN10;
+}
+
+/** Decimal logarithm (64-bit floating point)
+ *
+ * Compute logarithm value.
+ *
+ * @param arg Logarithm argument.
+ *
+ * @return Logarithm value.
+ *
+ */
+float64_t float64_log10(float64_t arg)
+{
+	return log_f64(arg) / M_LN10;
+}
+
+
+/** @}
+ */
Index: pace/lib/math/generic/mod.c
===================================================================
--- uspace/lib/math/generic/mod.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/*
- * Copyright (c) 2014 Martin Decky
- * 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 libmath
- * @{
- */
-/** @file
- */
-
-#include <math.h>
-#include <mod.h>
-
-/** Remainder function (32-bit floating point)
- *
- * Calculate the modulo of dividend by divisor.
- *
- * This is a very basic implementation that uses
- * division and multiplication (instead of exact
- * arithmetics). Thus the result might be very
- * imprecise (depending on the magnitude of the
- * arguments).
- *
- * @param dividend Dividend.
- * @param divisor  Divisor.
- *
- * @return Modulo.
- *
- */
-float32_t float32_mod(float32_t dividend, float32_t divisor)
-{
-	// FIXME: replace with exact arithmetics
-	
-	float32_t quotient = trunc_f32(dividend / divisor);
-	
-	return (dividend - quotient * divisor);
-}
-
-/** Remainder function (64-bit floating point)
- *
- * Calculate the modulo of dividend by divisor.
- *
- * This is a very basic implementation that uses
- * division and multiplication (instead of exact
- * arithmetics). Thus the result might be very
- * imprecise (depending on the magnitude of the
- * arguments).
- *
- * @param dividend Dividend.
- * @param divisor  Divisor.
- *
- * @return Modulo.
- *
- */
-float64_t float64_mod(float64_t dividend, float64_t divisor)
-{
-	// FIXME: replace with exact arithmetics
-	
-	float64_t quotient = trunc_f64(dividend / divisor);
-	
-	return (dividend - quotient * divisor);
-}
-
-/** @}
- */
Index: uspace/lib/math/generic/modf.c
===================================================================
--- uspace/lib/math/generic/modf.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/modf.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <modf.h>
+
+/** Remainder function (32-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float32_t float32_modf(float32_t value, float32_t *iptr)
+{
+	*iptr = trunc_f32(value);
+	return value - *iptr;
+}
+
+/** Remainder function (64-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float64_t float64_modf(float64_t value, float64_t *iptr)
+{
+	*iptr = trunc_f64(value);
+	return value - *iptr;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/pow.c
===================================================================
--- uspace/lib/math/generic/pow.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/generic/pow.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -34,6 +34,4 @@
  */
 
-#include <exp.h>
-#include <log.h>
 #include <math.h>
 #include <pow.h>
Index: uspace/lib/math/generic/sinh.c
===================================================================
--- uspace/lib/math/generic/sinh.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/sinh.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <sinh.h>
+
+/** Hyperbolic sine (32-bit floating point)
+ *
+ * Compute hyperbolic sine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic sine.
+ *
+ */
+float32_t float32_sinh(float32_t arg)
+{
+	return (exp_f32(arg) - exp_f32(-arg)) / 2.0;
+}
+
+/** Hyperbolic sine (64-bit floating point)
+ *
+ * Compute hyperbolic sine value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic sine.
+ *
+ */
+float64_t float64_sinh(float64_t arg)
+{
+	return (exp_f64(arg) - exp_f64(-arg)) / 2.0;
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/sqrt.c
===================================================================
--- uspace/lib/math/generic/sqrt.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/sqrt.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <sqrt.h>
+
+/** Single precision square root
+ *
+ * Compute square root.
+ *
+ * @param val Value
+ *
+ * @return Square root.
+ *
+ */
+float32_t float32_sqrt(float32_t val)
+{
+	return pow_f32(val, 0.5);
+}
+
+/** Double precision square root
+ *
+ * Compute squre root.
+ *
+ * @param val Value
+ *
+ * @return Square root.
+ *
+ */
+float64_t float64_sqrt(float64_t val)
+{
+	return pow_f64(val, 0.5);
+}
+
+/** @}
+ */
Index: uspace/lib/math/generic/tan.c
===================================================================
--- uspace/lib/math/generic/tan.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/tan.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <tan.h>
+
+/** Tangent (32-bit floating point)
+ *
+ * Compute tangent value.
+ *
+ * @param arg Tangent argument.
+ *
+ * @return Tangent value.
+ *
+ */
+float32_t float32_tan(float32_t arg)
+{
+	return sin_f32(arg) / cos_f32(arg);
+}
+
+/** Sine (64-bit floating point)
+ *
+ * Compute sine value.
+ *
+ * @param arg Sine argument.
+ *
+ * @return Sine value.
+ *
+ */
+float64_t float64_tan(float64_t arg)
+{
+	return sin_f64(arg) / cos_f64(arg);
+}
+
+
+/** @}
+ */
Index: uspace/lib/math/generic/tanh.c
===================================================================
--- uspace/lib/math/generic/tanh.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/generic/tanh.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#include <math.h>
+#include <tanh.h>
+
+/** Hyperbolic tangent (32-bit floating point)
+ *
+ * Compute hyperbolic tangent value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic tangent.
+ *
+ */
+float32_t float32_tanh(float32_t arg)
+{
+	float32_t em2x;
+
+	if (arg > 9.0)
+		return 1.0;
+	if (arg < -9.0)
+		return -1.0;
+
+	em2x = exp_f32(-2.0 * arg);
+	return (1.0 - em2x) / (1.0 + em2x);
+}
+
+/** Hyperbolic tangent (64-bit floating point)
+ *
+ * Compute hyperbolic tangent value.
+ *
+ * @param arg Hyperbolic angle
+ *
+ * @return Hyperbolic tangent.
+ *
+ */
+float64_t float64_tanh(float64_t arg)
+{
+	float64_t em2x;
+
+	if (arg > 19.0)
+		return 1.0;
+	if (arg < -19.0)
+		return -1.0;
+
+	em2x = exp_f64(-2.0 * arg);
+	return (1.0 - em2x) / (1.0 + em2x);
+}
+
+/** @}
+ */
Index: uspace/lib/math/include/acos.h
===================================================================
--- uspace/lib/math/include/acos.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/acos.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_ACOS_H_
+#define LIBMATH_ACOS_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_acos(float32_t);
+extern float64_t float64_acos(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/asin.h
===================================================================
--- uspace/lib/math/include/asin.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/asin.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_ASIN_H_
+#define LIBMATH_ASIN_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_asin(float32_t);
+extern float64_t float64_asin(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/atan.h
===================================================================
--- uspace/lib/math/include/atan.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/atan.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_ATAN_H_
+#define LIBMATH_ATAN_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_atan(float32_t);
+extern float64_t float64_atan(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/atan2.h
===================================================================
--- uspace/lib/math/include/atan2.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/atan2.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_ATAN2_H_
+#define LIBMATH_ATAN2_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_atan2(float32_t, float32_t);
+extern float64_t float64_atan2(float64_t, float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/cosh.h
===================================================================
--- uspace/lib/math/include/cosh.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/cosh.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_COSH_H_
+#define LIBMATH_COSH_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_cosh(float32_t);
+extern float64_t float64_cosh(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/fabs.h
===================================================================
--- uspace/lib/math/include/fabs.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/fabs.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_FABS_H_
+#define LIBMATH_FABS_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_fabs(float32_t);
+extern float64_t float64_fabs(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/fmod.h
===================================================================
--- uspace/lib/math/include/fmod.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/fmod.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2014 Martin Decky
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_FMOD_H_
+#define LIBMATH_FMOD_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_fmod(float32_t, float32_t);
+extern float64_t float64_fmod(float64_t, float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/frexp.h
===================================================================
--- uspace/lib/math/include/frexp.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/frexp.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_FREXP_H_
+#define LIBMATH_FREXP_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_frexp(float32_t, int *);
+extern float64_t float64_frexp(float64_t, int *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/ldexp.h
===================================================================
--- uspace/lib/math/include/ldexp.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/ldexp.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_LDEXP_H_
+#define LIBMATH_LDEXP_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_ldexp(float32_t, int);
+extern float64_t float64_ldexp(float64_t, int);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/log10.h
===================================================================
--- uspace/lib/math/include/log10.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/log10.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_LOG10_H_
+#define LIBMATH_LOG10_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_log10(float32_t);
+extern float64_t float64_log10(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/math.h
===================================================================
--- uspace/lib/math/include/math.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/math/include/math.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2011 Petr Koupy
+ * Copyright (c) 2015 Jiri Svoboda
  * All rights reserved.
  *
@@ -38,7 +39,9 @@
 #include <libarch/math.h>
 
+#define M_LN10 2.30258509299404568402
 #define M_LN2 0.69314718055994530942
 #define M_LOG2E 1.4426950408889634074
 #define M_PI 3.14159265358979323846
+#define M_PI_2 1.57079632679489661923
 
 #endif
Index: pace/lib/math/include/mod.h
===================================================================
--- uspace/lib/math/include/mod.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * Copyright (c) 2014 Martin Decky
- * 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 libmath
- * @{
- */
-/** @file
- */
-
-#ifndef LIBMATH_MOD_H_
-#define LIBMATH_MOD_H_
-
-extern float32_t float32_mod(float32_t, float32_t);
-extern float64_t float64_mod(float64_t, float64_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/math/include/modf.h
===================================================================
--- uspace/lib/math/include/modf.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/modf.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_MODF_H_
+#define LIBMATH_MODF_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_modf(float32_t, float32_t *);
+extern float64_t float64_modf(float64_t, float64_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/sinh.h
===================================================================
--- uspace/lib/math/include/sinh.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/sinh.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_SINH_H_
+#define LIBMATH_SINH_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_sinh(float32_t);
+extern float64_t float64_sinh(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/sqrt.h
===================================================================
--- uspace/lib/math/include/sqrt.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/sqrt.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_SQRT_H_
+#define LIBMATH_SQRT_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_sqrt(float32_t);
+extern float64_t float64_sqrt(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/tan.h
===================================================================
--- uspace/lib/math/include/tan.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/tan.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_TAN_H_
+#define LIBMATH_TAN_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_tan(float32_t);
+extern float64_t float64_tan(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/math/include/tanh.h
===================================================================
--- uspace/lib/math/include/tanh.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
+++ uspace/lib/math/include/tanh.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015 Jiri Svoboda
+ * 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 libmath
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBMATH_TANH_H_
+#define LIBMATH_TANH_H_
+
+#include <mathtypes.h>
+
+extern float32_t float32_tanh(float32_t);
+extern float64_t float64_tanh(float64_t);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/nettl/src/amap.c
===================================================================
--- uspace/lib/nettl/src/amap.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/nettl/src/amap.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -349,5 +349,5 @@
  * @param aepp Place to store actual endpoint pair, possibly with allocated port
  *
- * @return EOK on success, EEXISTS if conflicting epp exists,
+ * @return EOK on success, EEXIST if conflicting epp exists,
  *         ENOMEM if out of memory
  */
@@ -394,5 +394,5 @@
  * @param aepp Place to store actual endpoint pair, possibly with allocated port
  *
- * @return EOK on success, EEXISTS if conflicting epp exists,
+ * @return EOK on success, EEXIST if conflicting epp exists,
  *         ENOMEM if out of memory
  */
@@ -438,5 +438,5 @@
  * @param aepp Place to store actual endpoint pair, possibly with allocated port
  *
- * @return EOK on success, EEXISTS if conflicting epp exists,
+ * @return EOK on success, EEXIST if conflicting epp exists,
  *         ENOMEM if out of memory
  */
@@ -482,5 +482,5 @@
  * @param aepp Place to store actual endpoint pair, possibly with allocated port
  *
- * @return EOK on success, EEXISTS if conflicting epp exists,
+ * @return EOK on success, EEXIST if conflicting epp exists,
  *         ENOMEM if out of memory
  */
@@ -515,5 +515,5 @@
  * @param aepp Place to store actual endpoint pair, possibly with allocated port
  *
- * @return EOK on success, EEXISTS if conflicting epp exists,
+ * @return EOK on success, EEXIST if conflicting epp exists,
  *         ENOMEM if out of memory
  */
Index: uspace/lib/nettl/src/portrng.c
===================================================================
--- uspace/lib/nettl/src/portrng.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/nettl/src/portrng.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -88,5 +88,5 @@
  * @param apnum Place to store allocated port number
  *
- * @return EOK on success, ENOENT if no free port number found, EEXISTS
+ * @return EOK on success, ENOENT if no free port number found, EEXIST
  *         if @a pnum is specified but it is already allocated,
  *         EINVAL if @a pnum is specified from the system range, but
@@ -137,5 +137,5 @@
 			if (port->pn == pnum) {
 				log_msg(LOG_DEFAULT, LVL_DEBUG2, "port already used");
-				return EEXISTS;
+				return EEXIST;
 			}
 		}
Index: uspace/lib/pcut/src/os/helenos.c
===================================================================
--- uspace/lib/pcut/src/os/helenos.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/pcut/src/os/helenos.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -220,5 +220,5 @@
 	fibril_mutex_unlock(&forced_termination_mutex);
 
-	read_all(tempfile, extra_output_buffer, OUTPUT_BUFFER_SIZE);
+	read(tempfile, extra_output_buffer, OUTPUT_BUFFER_SIZE);
 
 leave_close_tempfile:
Index: uspace/lib/posix/include/posix/inttypes.h
===================================================================
--- uspace/lib/posix/include/posix/inttypes.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/include/posix/inttypes.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -43,7 +43,7 @@
 #include "libc/inttypes.h"
 
-extern __POSIX_DEF__(intmax_t) __POSIX_DEF__(strtoimax)(const char *restrict nptr,
+extern intmax_t __POSIX_DEF__(strtoimax)(const char *restrict nptr,
     char **restrict endptr, int base);
-extern __POSIX_DEF__(uintmax_t) __POSIX_DEF__(strtoumax)(const char *restrict nptr,
+extern uintmax_t __POSIX_DEF__(strtoumax)(const char *restrict nptr,
     char **restrict endptr, int base);
 
Index: uspace/lib/posix/include/posix/stddef.h
===================================================================
--- uspace/lib/posix/include/posix/stddef.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/include/posix/stddef.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -48,7 +48,4 @@
 #define offsetof(type,member) ((size_t) &(((type *) 0)->member))
 
-typedef ssize_t __POSIX_DEF__(ptrdiff_t);
-
-
 #endif /* POSIX_STDDEF_H_ */
 
Index: uspace/lib/posix/include/posix/stdint.h
===================================================================
--- uspace/lib/posix/include/posix/stdint.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/include/posix/stdint.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -104,12 +104,10 @@
 #include "libc/sys/types.h"
 
-typedef int64_t __POSIX_DEF__(intmax_t);
-typedef uint64_t __POSIX_DEF__(uintmax_t);
-
-
 /*
  * Fast* and least* integer types.
  *
- * The definitions below are definitely safe if not the best.
+ * The definitions below are correct as long as uint8/16/32/64_t are defined.
+ * Considering the entire rest of the system would break down if they were not,
+ * these definitions are just fine.
  */
 typedef uint8_t uint_least8_t;
Index: uspace/lib/posix/source/fcntl.c
===================================================================
--- uspace/lib/posix/source/fcntl.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/fcntl.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -112,11 +112,5 @@
 	}
 
-	int rc = open(pathname, flags, mode);
-	if (rc < 0) {
-		errno = -rc;
-		rc = -1;
-	}
-
-	return rc;
+	return negerrno(open, pathname, flags, mode);
 }
 
Index: uspace/lib/posix/source/internal/common.h
===================================================================
--- uspace/lib/posix/source/internal/common.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/internal/common.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -48,10 +48,9 @@
 	} while (0)
 
-/* A little helper macro to avoid typing this over and over. */
-#define errnify(func, ...) ({ \
+/* Convert negative errno to positive errno */
+#define negerrno(func, ...) ({ \
 	int rc = func(__VA_ARGS__); \
 	if (rc < 0) { \
-		errno = -rc; \
-		rc = -1; \
+		errno = -errno; \
 	} \
 	rc; \
Index: uspace/lib/posix/source/stdio.c
===================================================================
--- uspace/lib/posix/source/stdio.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/stdio.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -55,10 +55,4 @@
 #include "libc/sys/stat.h"
 
-
-/* not the best of solutions, but freopen and ungetc will eventually
- * need to be implemented in libc anyway
- */
-#include "../../c/generic/private/stdio.h"
-
 /** Clears the stream's error and end-of-file indicators.
  *
@@ -67,6 +61,5 @@
 void posix_clearerr(FILE *stream)
 {
-	stream->error = 0;
-	stream->eof = 0;
+	clearerr(stream);
 }
 
@@ -101,10 +94,5 @@
 int posix_fputs(const char *restrict s, FILE *restrict stream)
 {
-	int rc = fputs(s, stream);
-	if (rc == 0) {
-		return EOF;
-	} else {
-		return 0;
-	}
+	return fputs(s, stream);
 }
 
@@ -118,33 +106,5 @@
 int posix_ungetc(int c, FILE *stream)
 {
-	uint8_t b = (uint8_t) c;
-
-	bool can_unget =
-	    /* Provided character is legal. */
-	    c != EOF &&
-	    /* Stream is consistent. */
-	    !stream->error &&
-	    /* Stream is buffered. */
-	    stream->btype != _IONBF &&
-	    /* Last operation on the stream was a read operation. */
-	    stream->buf_state == _bs_read &&
-	    /* Stream buffer is already allocated (i.e. there was already carried
-	     * out either write or read operation on the stream). This is probably
-	     * redundant check but let's be safe. */
-	    stream->buf != NULL &&
-	    /* There is still space in the stream to retreat. POSIX demands the
-	     * possibility to unget at least 1 character. It should be always
-	     * possible, assuming the last operation on the stream read at least 1
-	     * character, because the buffer is refilled in the lazily manner. */
-	    stream->buf_tail > stream->buf;
-
-	if (can_unget) {
-		--stream->buf_tail;
-		stream->buf_tail[0] = b;
-		stream->eof = false;
-		return (int) b;
-	} else {
-		return EOF;
-	}
+	return ungetc(c, stream);
 }
 
@@ -254,43 +214,5 @@
     const char *restrict mode, FILE *restrict stream)
 {
-	assert(mode != NULL);
-	assert(stream != NULL);
-	
-	if (filename == NULL) {
-		/* POSIX allows this to be imlementation-defined. HelenOS currently
-		 * does not support changing the mode. */
-		// FIXME: handle mode change once it is supported
-		return stream;
-	}
-	
-	/* Open a new stream. */
-	FILE* new = fopen(filename, mode);
-	if (new == NULL) {
-		fclose(stream);
-		/* errno was set by fopen() */
-		return NULL;
-	}
-	
-	/* Close the original stream without freeing it (ignoring errors). */
-	if (stream->buf != NULL) {
-		fflush(stream);
-	}
-	if (stream->sess != NULL) {
-		async_hangup(stream->sess);
-	}
-	if (stream->fd >= 0) {
-		close(stream->fd);
-	}
-	list_remove(&stream->link);
-	
-	/* Move the new stream to the original location. */
-	memcpy(stream, new, sizeof (FILE));
-	free(new);
-	
-	/* Update references in the file list. */
-	stream->link.next->prev = &stream->link;
-	stream->link.prev->next = &stream->link;
-	
-	return stream;
+	return freopen(filename, mode, stream);
 }
 
@@ -393,11 +315,5 @@
 int posix_fflush(FILE *stream)
 {
-	int rc = fflush(stream);
-	if (rc < 0) {
-		errno = -rc;
-		return EOF;
-	} else {
-		return 0;
-	}
+	return negerrno(fflush, stream);
 }
 
@@ -429,4 +345,6 @@
 {
 	ssize_t wr = write(*(int *) fd, str, size);
+	if (wr < 0)
+		return errno;
 	return str_nlength(str, wr);
 }
@@ -657,23 +575,5 @@
 int posix_remove(const char *path)
 {
-	struct stat st;
-	int rc = stat(path, &st);
-	
-	if (rc != EOK) {
-		errno = -rc;
-		return -1;
-	}
-	
-	if (st.is_directory) {
-		rc = rmdir(path);
-	} else {
-		rc = unlink(path);
-	}
-	
-	if (rc != EOK) {
-		errno = -rc;
-		return -1;
-	}
-	return 0;
+	return negerrno(remove, path);
 }
 
@@ -687,5 +587,5 @@
 int posix_rename(const char *old, const char *new)
 {
-	return errnify(rename, old, new);
+	return negerrno(rename, old, new);
 }
 
Index: uspace/lib/posix/source/stdio/scanf.c
===================================================================
--- uspace/lib/posix/source/stdio/scanf.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/stdio/scanf.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -698,6 +698,6 @@
 							break;
 						case LMOD_j: ;
-							posix_uintmax_t *pj = va_arg(arg, posix_uintmax_t *);
-							*pj = (posix_uintmax_t) ures;
+							uintmax_t *pj = va_arg(arg, uintmax_t *);
+							*pj = (uintmax_t) ures;
 							break;
 						case LMOD_z: ;
@@ -740,6 +740,6 @@
 							break;
 						case LMOD_j: ;
-							posix_intmax_t *pj = va_arg(arg, posix_intmax_t *);
-							*pj = (posix_intmax_t) sres;
+							intmax_t *pj = va_arg(arg, intmax_t *);
+							*pj = (intmax_t) sres;
 							break;
 						case LMOD_z: ;
@@ -748,6 +748,6 @@
 							break;
 						case LMOD_t: ;
-							posix_ptrdiff_t *pt = va_arg(arg, posix_ptrdiff_t *);
-							*pt = (posix_ptrdiff_t) sres;
+							ptrdiff_t *pt = va_arg(arg, ptrdiff_t *);
+							*pt = (ptrdiff_t) sres;
 							break;
 						default:
Index: uspace/lib/posix/source/stdlib.c
===================================================================
--- uspace/lib/posix/source/stdlib.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/stdlib.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -278,5 +278,5 @@
 	 * to be updated when that support is implemented.
 	 */
-	char* absolute = absolutize(name, NULL);
+	char* absolute = vfs_absolutize(name, NULL);
 	
 	if (absolute == NULL) {
Index: uspace/lib/posix/source/stdlib/strtol.c
===================================================================
--- uspace/lib/posix/source/stdlib/strtol.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/stdlib/strtol.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -43,7 +43,4 @@
 #include "posix/inttypes.h"
 #include "posix/limits.h"
-
-#define intmax_t posix_intmax_t
-#define uintmax_t posix_uintmax_t
 
 /**
Index: uspace/lib/posix/source/sys/stat.c
===================================================================
--- uspace/lib/posix/source/sys/stat.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/sys/stat.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -80,10 +80,7 @@
 {
 	struct stat hst;
-	int rc = fstat(fd, &hst);
-	if (rc < 0) {
-		/* fstat() returns negative error code instead of using errno. */
-		errno = -rc;
-		return -1;
-	}
+	int rc = negerrno(fstat, fd, &hst);
+	if (rc < 0)
+		return rc;
 	stat_to_posix(st, &hst);
 	return 0;
@@ -113,10 +110,7 @@
 {
 	struct stat hst;
-	int rc = stat(path, &hst);
-	if (rc < 0) {
-		/* stat() returns negative error code instead of using errno. */
-		errno = -rc;
-		return -1;
-	}
+	int rc = negerrno(stat, path, &hst);
+	if (rc < 0)
+		return rc;
 	stat_to_posix(st, &hst);
 	return 0;
Index: uspace/lib/posix/source/unistd.c
===================================================================
--- uspace/lib/posix/source/unistd.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/posix/source/unistd.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -105,31 +105,12 @@
 char *posix_getcwd(char *buf, size_t size)
 {
-	/* Native getcwd() does not set any errno despite the fact that general
-	 * usage pattern of this function depends on it (caller is repeatedly
-	 * guessing the required size of the buffer by checking for ERANGE on
-	 * failure). */
-	if (size == 0) {
-		errno = EINVAL;
+	char *p = getcwd(buf, size);
+
+	if (p == NULL) {
+		errno = -errno;
 		return NULL;
 	}
-	
-	/* Save the original value to comply with the "no modification on
-	 * success" semantics.
-	 */
-	int orig_errno = errno;
-	errno = EOK;
-	
-	char *ret = getcwd(buf, size);
-	if (ret == NULL) {
-		/* Check errno to avoid shadowing other possible errors. */
-		if (errno == EOK) {
-			errno = ERANGE;
-		}
-	} else {
-		/* Success, restore previous errno value. */
-		errno = orig_errno;
-	}
-	
-	return ret;
+
+	return p;
 }
 
@@ -141,5 +122,5 @@
 int posix_chdir(const char *path)
 {
-	return errnify(chdir, path);
+	return negerrno(chdir, path);
 }
 
@@ -194,5 +175,5 @@
 int posix_close(int fildes)
 {
-	return errnify(close, fildes);
+	return negerrno(close, fildes);
 }
 
@@ -207,5 +188,5 @@
 ssize_t posix_read(int fildes, void *buf, size_t nbyte)
 {
-	return errnify(read, fildes, buf, nbyte);
+	return negerrno(read, fildes, buf, nbyte);
 }
 
@@ -220,5 +201,5 @@
 ssize_t posix_write(int fildes, const void *buf, size_t nbyte)
 {
-	return errnify(write, fildes, buf, nbyte);
+	return negerrno(write, fildes, buf, nbyte);
 }
 
@@ -234,5 +215,5 @@
 posix_off_t posix_lseek(int fildes, posix_off_t offset, int whence)
 {
-	return errnify(lseek, fildes, offset, whence);
+	return negerrno(lseek, fildes, offset, whence);
 }
 
@@ -245,5 +226,5 @@
 int posix_fsync(int fildes)
 {
-	return errnify(fsync, fildes);
+	return negerrno(fsync, fildes);
 }
 
@@ -257,5 +238,5 @@
 int posix_ftruncate(int fildes, posix_off_t length)
 {
-	return errnify(ftruncate, fildes, (aoff64_t) length);
+	return negerrno(ftruncate, fildes, (aoff64_t) length);
 }
 
@@ -268,5 +249,5 @@
 int posix_rmdir(const char *path)
 {
-	return errnify(rmdir, path);
+	return negerrno(rmdir, path);
 }
 
@@ -279,5 +260,5 @@
 int posix_unlink(const char *path)
 {
-	return errnify(unlink, path);
+	return negerrno(unlink, path);
 }
 
@@ -303,5 +284,5 @@
 int posix_dup2(int fildes, int fildes2)
 {
-	return errnify(dup2, fildes, fildes2);
+	return negerrno(dup2, fildes, fildes2);
 }
 
@@ -321,7 +302,7 @@
 		 * Check file existence by attempting to open it.
 		 */
-		int fd = open(path, O_RDONLY);
+		int fd = negerrno(open, path, O_RDONLY);
 		if (fd < 0) {
-			errno = -fd;
+			/* errno was set by open() */
 			return -1;
 		}
Index: uspace/lib/usbdev/src/pipesinit.c
===================================================================
--- uspace/lib/usbdev/src/pipesinit.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/usbdev/src/pipesinit.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -190,5 +190,5 @@
 
 	if (ep_mapping->present) {
-		return EEXISTS;
+		return EEXIST;
 	}
 
Index: uspace/lib/usbhost/src/usb_device_manager.c
===================================================================
--- uspace/lib/usbhost/src/usb_device_manager.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/usbhost/src/usb_device_manager.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -150,5 +150,5 @@
 	if (instance->devices[address].handle != 0) {
 		fibril_mutex_unlock(&instance->guard);
-		return EEXISTS;
+		return EEXIST;
 	}
 	instance->devices[address].handle = handle;
Index: uspace/lib/usbhost/src/usb_endpoint_manager.c
===================================================================
--- uspace/lib/usbhost/src/usb_endpoint_manager.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/lib/usbhost/src/usb_endpoint_manager.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -253,5 +253,5 @@
 	if (endpoint != NULL) {
 		fibril_mutex_unlock(&instance->guard);
-		return EEXISTS;
+		return EEXIST;
 	}
 	list_append(&ep->link, get_list(instance, ep->address));
@@ -339,5 +339,5 @@
 	if (ep != NULL) {
 		fibril_mutex_unlock(&instance->guard);
-		return EEXISTS;
+		return EEXIST;
 	}
 
Index: uspace/srv/audio/hound/audio_sink.c
===================================================================
--- uspace/srv/audio/hound/audio_sink.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/audio/hound/audio_sink.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -103,5 +103,5 @@
 	if (!pcm_format_is_any(&sink->format)) {
 		log_debug("Sink %s already has a format", sink->name);
-		return EEXISTS;
+		return EEXIST;
 	}
 	const pcm_format_t old_format = sink->format;
Index: uspace/srv/audio/hound/hound.c
===================================================================
--- uspace/srv/audio/hound/hound.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/audio/hound/hound.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -267,5 +267,5 @@
 		if (dev->id == id) {
 			log_debug("Device with id %zu is already present", id);
-			return EEXISTS;
+			return EEXIST;
 		}
 	}
@@ -274,5 +274,5 @@
 	if (dev) {
 		log_debug("Device with name %s is already present", name);
-		return EEXISTS;
+		return EEXIST;
 	}
 
@@ -341,5 +341,5 @@
 		log_debug("Source by that name already exists");
 		fibril_mutex_unlock(&hound->list_guard);
-		return EEXISTS;
+		return EEXIST;
 	}
 	list_append(&source->link, &hound->sources);
@@ -365,5 +365,5 @@
 		log_debug("Sink by that name already exists");
 		fibril_mutex_unlock(&hound->list_guard);
-		return EEXISTS;
+		return EEXIST;
 	}
 	list_append(&sink->link, &hound->sinks);
Index: uspace/srv/devman/driver.c
===================================================================
--- uspace/srv/devman/driver.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/devman/driver.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -142,5 +142,5 @@
 	/* Check whether the driver's binary exists. */
 	struct stat s;
-	if (stat(drv->binary_path, &s) == ENOENT) { /* FIXME!! */
+	if (stat(drv->binary_path, &s) != 0) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Driver not found at path `%s'.",
 		    drv->binary_path);
Index: uspace/srv/devman/drv_conn.c
===================================================================
--- uspace/srv/devman/drv_conn.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/devman/drv_conn.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -101,5 +101,5 @@
 		    driver->name);
 		fibril_mutex_unlock(&driver->driver_mutex);
-		async_answer_0(callid, EEXISTS);
+		async_answer_0(callid, EEXIST);
 		return NULL;
 	}
@@ -278,5 +278,5 @@
 		fibril_rwlock_write_unlock(&tree->rwlock);
 		dev_del_ref(pdev);
-		async_answer_0(callid, EEXISTS);
+		async_answer_0(callid, EEXIST);
 		printf(NAME ": Warning, driver tried to register `%s' twice.\n",
 		    fun_name);
Index: uspace/srv/devman/match.c
===================================================================
--- uspace/srv/devman/match.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/devman/match.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -31,4 +31,5 @@
  */
 
+#include <errno.h>
 #include <fcntl.h>
 #include <io/log.h>
@@ -197,5 +198,5 @@
 	if (fd < 0) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.",
-		    conf_path, str_error(fd));
+		    conf_path, str_error(errno));
 		goto cleanup;
 	}
@@ -217,8 +218,8 @@
 	}
 	
-	ssize_t read_bytes = read_all(fd, buf, len);
+	ssize_t read_bytes = read(fd, buf, len);
 	if (read_bytes <= 0) {
-		log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%zd).", conf_path,
-		    read_bytes);
+		log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%d).", conf_path,
+		    errno);
 		goto cleanup;
 	}
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/loader/main.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -249,5 +249,5 @@
 		}
 		async_state_change_finalize(callid, vfs_exch);
-		fd = fd_wait();
+		fd = vfs_fd_wait();
 		assert(fd == (int) filc);
 	}
Index: uspace/srv/locsrv/locsrv.c
===================================================================
--- uspace/srv/locsrv/locsrv.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/locsrv/locsrv.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -412,5 +412,5 @@
 {
 	if (server == NULL)
-		return EEXISTS;
+		return EEXIST;
 	
 	fibril_mutex_lock(&servers_list_mutex);
@@ -511,5 +511,5 @@
 		free(service->name);
 		free(service);
-		async_answer_0(iid, EEXISTS);
+		async_answer_0(iid, EEXIST);
 		return;
 	}
@@ -951,5 +951,5 @@
 	    loc_namespace_find_id(IPC_GET_ARG1(*icall));
 	if (namespace == NULL)
-		async_answer_0(iid, EEXISTS);
+		async_answer_0(iid, EEXIST);
 	else
 		async_answer_1(iid, EOK, namespace->refcnt);
Index: uspace/srv/net/inetsrv/addrobj.c
===================================================================
--- uspace/srv/net/inetsrv/addrobj.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/net/inetsrv/addrobj.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -87,5 +87,5 @@
 		/* Duplicate address name */
 		fibril_mutex_unlock(&addr_list_lock);
-		return EEXISTS;
+		return EEXIST;
 	}
 
Index: uspace/srv/net/tcp/conn.c
===================================================================
--- uspace/srv/net/tcp/conn.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/net/tcp/conn.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -1223,5 +1223,5 @@
 		rc = amap_insert(amap, &conn->ident, conn, af_allow_system, &aepp);
 		if (rc != EOK) {
-			assert(rc != EEXISTS);
+			assert(rc != EEXIST);
 			assert(rc == ENOMEM);
 			log_msg(LOG_DEFAULT, LVL_ERROR, "Out of memory.");
Index: uspace/srv/ns/service.c
===================================================================
--- uspace/srv/ns/service.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/ns/service.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -143,5 +143,5 @@
 {
 	if (hash_table_find(&service_hash_table, &service))
-		return EEXISTS;
+		return EEXIST;
 	
 	hashed_service_t *hashed_service =
Index: uspace/srv/ns/task.c
===================================================================
--- uspace/srv/ns/task.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/ns/task.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -235,5 +235,5 @@
 	ht_link_t *link = hash_table_find(&phone_to_id, &call->in_phone_hash);
 	if (link != NULL)
-		return EEXISTS;
+		return EEXIST;
 	
 	p2i_entry_t *entry = (p2i_entry_t *) malloc(sizeof(p2i_entry_t));
Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/vfs/vfs.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -74,8 +74,8 @@
 			break;
 		case VFS_IN_MOUNT:
-			vfs_mount(callid, &call);
+			vfs_mount_srv(callid, &call);
 			break;
 		case VFS_IN_UNMOUNT:
-			vfs_unmount(callid, &call);
+			vfs_unmount_srv(callid, &call);
 			break;
 		case VFS_IN_OPEN:
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/vfs/vfs.h	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -205,6 +205,6 @@
 
 extern void vfs_register(ipc_callid_t, ipc_call_t *);
-extern void vfs_mount(ipc_callid_t, ipc_call_t *);
-extern void vfs_unmount(ipc_callid_t, ipc_call_t *);
+extern void vfs_mount_srv(ipc_callid_t, ipc_call_t *);
+extern void vfs_unmount_srv(ipc_callid_t, ipc_call_t *);
 extern void vfs_open(ipc_callid_t, ipc_call_t *);
 extern void vfs_sync(ipc_callid_t, ipc_call_t *);
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/vfs/vfs_ops.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -266,5 +266,5 @@
 }
 
-void vfs_mount(ipc_callid_t rid, ipc_call_t *request)
+void vfs_mount_srv(ipc_callid_t rid, ipc_call_t *request)
 {
 	service_id_t service_id;
@@ -405,5 +405,5 @@
 }
 
-void vfs_unmount(ipc_callid_t rid, ipc_call_t *request)
+void vfs_unmount_srv(ipc_callid_t rid, ipc_call_t *request)
 {
 	int rc;
Index: uspace/srv/vfs/vfs_register.c
===================================================================
--- uspace/srv/vfs/vfs_register.c	(revision 5783d107385593ef688fcb9ee4a1447a4e4d6e68)
+++ uspace/srv/vfs/vfs_register.c	(revision 5265eea4b6e13925ae465dd16a7d61a8c7dd994d)
@@ -162,5 +162,5 @@
 		fibril_mutex_unlock(&fs_list_lock);
 		free(fs_info);
-		async_answer_0(rid, EEXISTS);
+		async_answer_0(rid, EEXIST);
 		return;
 	}
