Index: uspace/lib/c/generic/io/asprintf.c
===================================================================
--- uspace/lib/c/generic/io/asprintf.c	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ uspace/lib/c/generic/io/asprintf.c	(revision 163e34ce66d8952017bc5a812affc2f72443b230)
@@ -40,35 +40,4 @@
 #include <str.h>
 #include <printf_core.h>
-
-static int asprintf_str_write(const char *str, size_t count, void *unused)
-{
-	return str_nlength(str, count);
-}
-
-static int asprintf_wstr_write(const char32_t *str, size_t count, void *unused)
-{
-	return wstr_nlength(str, count);
-}
-
-int vprintf_length(const char *fmt, va_list args)
-{
-	printf_spec_t ps = {
-		asprintf_str_write,
-		asprintf_wstr_write,
-		NULL
-	};
-
-	return printf_core(fmt, &ps, args);
-}
-
-int printf_length(const char *fmt, ...)
-{
-	va_list args;
-	va_start(args, fmt);
-	int ret = vprintf_length(fmt, args);
-	va_end(args);
-
-	return ret;
-}
 
 /** Allocate and print to string.
@@ -115,5 +84,4 @@
 	int ret = vasprintf(strp, fmt, args);
 	va_end(args);
-
 	return ret;
 }
Index: uspace/lib/c/generic/io/kio.c
===================================================================
--- uspace/lib/c/generic/io/kio.c	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ uspace/lib/c/generic/io/kio.c	(revision 163e34ce66d8952017bc5a812affc2f72443b230)
@@ -131,31 +131,8 @@
 }
 
-static int kio_vprintf_str_write(const char *str, size_t size, void *data)
+static errno_t kio_vprintf_str_write(const char *str, size_t size, void *data)
 {
-	size_t wr;
-
-	wr = 0;
-	(void) kio_write(str, size, &wr);
-	return str_nlength(str, wr);
-}
-
-static int kio_vprintf_wstr_write(const char32_t *str, size_t size, void *data)
-{
-	size_t offset = 0;
-	size_t chars = 0;
-	size_t wr;
-
-	while (offset < size) {
-		char buf[STR_BOUNDS(1)];
-		size_t sz = 0;
-
-		if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK)
-			kio_write(buf, sz, &wr);
-
-		chars++;
-		offset += sizeof(char32_t);
-	}
-
-	return chars;
+	size_t wr = 0;
+	return kio_write(str, size, &wr);
 }
 
@@ -172,5 +149,4 @@
 	printf_spec_t ps = {
 		kio_vprintf_str_write,
-		kio_vprintf_wstr_write,
 		NULL
 	};
Index: uspace/lib/c/generic/io/snprintf.c
===================================================================
--- uspace/lib/c/generic/io/snprintf.c	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-
-/** Print formatted to the given buffer with limited size.
- *
- * @param str  Buffer
- * @param size Buffer size
- * @param fmt  Format string
- *
- * \see For more details about format string see printf_core.
- *
- */
-int snprintf(char *str, size_t size, const char *fmt, ...)
-{
-	va_list args;
-	va_start(args, fmt);
-
-	int ret = vsnprintf(str, size, fmt, args);
-
-	va_end(args);
-
-	return ret;
-}
-
-/** @}
- */
Index: uspace/lib/c/generic/io/vprintf.c
===================================================================
--- uspace/lib/c/generic/io/vprintf.c	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ uspace/lib/c/generic/io/vprintf.c	(revision 163e34ce66d8952017bc5a812affc2f72443b230)
@@ -42,24 +42,19 @@
 static FIBRIL_MUTEX_INITIALIZE(printf_mutex);
 
-static int vprintf_str_write(const char *str, size_t size, void *stream)
+static errno_t vprintf_str_write(const char *str, size_t size, void *stream)
 {
-	size_t wr = fwrite(str, 1, size, (FILE *) stream);
-	return str_nlength(str, wr);
-}
+	errno_t old_errno = errno;
 
-static int vprintf_wstr_write(const char32_t *str, size_t size, void *stream)
-{
-	size_t offset = 0;
-	size_t chars = 0;
+	errno = EOK;
+	size_t written = fwrite(str, 1, size, (FILE *) stream);
 
-	while (offset < size) {
-		if (fputuc(str[chars], (FILE *) stream) <= 0)
-			break;
+	if (errno == EOK && written != size)
+		errno = EIO;
 
-		chars++;
-		offset += sizeof(char32_t);
-	}
+	if (errno != EOK)
+		return errno;
 
-	return chars;
+	errno = old_errno;
+	return EOK;
 }
 
@@ -77,5 +72,4 @@
 	printf_spec_t ps = {
 		vprintf_str_write,
-		vprintf_wstr_write,
 		stream
 	};
Index: uspace/lib/c/generic/io/vsnprintf.c
===================================================================
--- uspace/lib/c/generic/io/vsnprintf.c	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <str.h>
-#include <printf_core.h>
-#include <errno.h>
-
-typedef struct {
-	size_t size;    /* Total size of the buffer (in bytes) */
-	size_t len;     /* Number of already used bytes */
-	char *dst;      /* Destination */
-} vsnprintf_data_t;
-
-/** Write string to given buffer.
- *
- * Write at most data->size plain characters including trailing zero.
- * According to C99, snprintf() has to return number of characters that
- * would have been written if enough space had been available. Hence
- * the return value is not the number of actually printed characters
- * but size of the input string.
- *
- * @param str  Source string to print.
- * @param size Number of plain characters in str.
- * @param data Structure describing destination string, counter
- *             of used space and total string size.
- *
- * @return Number of characters to print (not characters actually
- *         printed).
- *
- */
-static int vsnprintf_str_write(const char *str, size_t size, vsnprintf_data_t *data)
-{
-	size_t left = data->size - data->len;
-
-	if (left == 0)
-		return ((int) size);
-
-	if (left == 1) {
-		/*
-		 * We have only one free byte left in buffer
-		 * -> store trailing zero
-		 */
-		data->dst[data->size - 1] = 0;
-		data->len = data->size;
-		return ((int) size);
-	}
-
-	if (left <= size) {
-		/*
-		 * We do not have enough space for the whole string
-		 * with the trailing zero => print only a part
-		 * of string
-		 */
-		size_t index = 0;
-
-		while (index < size) {
-			char32_t uc = str_decode(str, &index, size);
-
-			if (chr_encode(uc, data->dst, &data->len, data->size - 1) != EOK)
-				break;
-		}
-
-		/*
-		 * Put trailing zero at end, but not count it
-		 * into data->len so it could be rewritten next time
-		 */
-		data->dst[data->len] = 0;
-
-		return ((int) size);
-	}
-
-	/* Buffer is big enough to print the whole string */
-	memcpy((void *)(data->dst + data->len), (void *) str, size);
-	data->len += size;
-
-	/*
-	 * Put trailing zero at end, but not count it
-	 * into data->len so it could be rewritten next time
-	 */
-	data->dst[data->len] = 0;
-
-	return ((int) size);
-}
-
-/** Write wide string to given buffer.
- *
- * Write at most data->size plain characters including trailing zero.
- * According to C99, snprintf() has to return number of characters that
- * would have been written if enough space had been available. Hence
- * the return value is not the number of actually printed characters
- * but size of the input string.
- *
- * @param str  Source wide string to print.
- * @param size Number of bytes in str.
- * @param data Structure describing destination string, counter
- *             of used space and total string size.
- *
- * @return Number of wide characters to print (not characters actually
- *         printed).
- *
- */
-static int vsnprintf_wstr_write(const char32_t *str, size_t size, vsnprintf_data_t *data)
-{
-	size_t index = 0;
-
-	while (index < (size / sizeof(char32_t))) {
-		size_t left = data->size - data->len;
-
-		if (left == 0)
-			return ((int) size);
-
-		if (left == 1) {
-			/*
-			 * We have only one free byte left in buffer
-			 * -> store trailing zero
-			 */
-			data->dst[data->size - 1] = 0;
-			data->len = data->size;
-			return ((int) size);
-		}
-
-		if (chr_encode(str[index], data->dst, &data->len, data->size - 1) != EOK)
-			break;
-
-		index++;
-	}
-
-	/*
-	 * Put trailing zero at end, but not count it
-	 * into data->len so it could be rewritten next time
-	 */
-	data->dst[data->len] = 0;
-
-	return ((int) size);
-}
-
-int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
-{
-	vsnprintf_data_t data = {
-		size,
-		0,
-		str
-	};
-	printf_spec_t ps = {
-		(int (*) (const char *, size_t, void *)) vsnprintf_str_write,
-		(int (*) (const char32_t *, size_t, void *)) vsnprintf_wstr_write,
-		&data
-	};
-
-	/* Print 0 at end of string - fix the case that nothing will be printed */
-	if (size > 0)
-		str[0] = 0;
-
-	/* vsnprintf_write ensures that str will be terminated by zero. */
-	return printf_core(fmt, &ps, ap);
-}
-
-/** @}
- */
Index: uspace/lib/c/include/stdio.h
===================================================================
--- uspace/lib/c/include/stdio.h	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ uspace/lib/c/include/stdio.h	(revision 163e34ce66d8952017bc5a812affc2f72443b230)
@@ -209,7 +209,4 @@
 };
 
-extern int vprintf_length(const char *, va_list);
-extern int printf_length(const char *, ...)
-    _HELENOS_PRINTF_ATTRIBUTE(1, 2);
 extern FILE *fdopen(int, const char *);
 extern int fileno(FILE *);
Index: uspace/lib/c/meson.build
===================================================================
--- uspace/lib/c/meson.build	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ uspace/lib/c/meson.build	(revision 163e34ce66d8952017bc5a812affc2f72443b230)
@@ -72,5 +72,7 @@
 	'common/stdc/mem.c',
 	'common/stdc/qsort.c',
+	'common/stdc/snprintf.c',
 	'common/stdc/uchar.c',
+	'common/stdc/vsnprintf.c',
 	'common/stdc/wchar.c',
 	'common/str.c',
@@ -113,8 +115,6 @@
 	'generic/io/logctl.c',
 	'generic/io/printf.c',
-	'generic/io/snprintf.c',
 	'generic/io/table.c',
 	'generic/io/vprintf.c',
-	'generic/io/vsnprintf.c',
 	'generic/ipc.c',
 	'generic/irq.c',
Index: uspace/lib/posix/src/stdio.c
===================================================================
--- uspace/lib/posix/src/stdio.c	(revision f167c851099aef2600cce71c5e10cc3f3dc8ee11)
+++ uspace/lib/posix/src/stdio.c	(revision 163e34ce66d8952017bc5a812affc2f72443b230)
@@ -232,44 +232,9 @@
  * @return The number of written characters.
  */
-static int _dprintf_str_write(const char *str, size_t size, void *fd)
+static errno_t _dprintf_str_write(const char *str, size_t size, void *fd)
 {
 	const int fildes = *(int *) fd;
 	size_t wr;
-	if (failed(vfs_write(fildes, &posix_pos[fildes], str, size, &wr)))
-		return -1;
-	return str_nlength(str, wr);
-}
-
-/**
- * Write wide string to the opened file.
- *
- * @param str String to be written.
- * @param size Size of the string (in bytes).
- * @param fd File descriptor of the opened file.
- * @return The number of written characters.
- */
-static int _dprintf_wstr_write(const char32_t *str, size_t size, void *fd)
-{
-	size_t offset = 0;
-	size_t chars = 0;
-	size_t sz;
-	char buf[4];
-
-	while (offset < size) {
-		sz = 0;
-		if (chr_encode(str[chars], buf, &sz, sizeof(buf)) != EOK) {
-			break;
-		}
-
-		const int fildes = *(int *) fd;
-		size_t nwr;
-		if (vfs_write(fildes, &posix_pos[fildes], buf, sz, &nwr) != EOK)
-			break;
-
-		chars++;
-		offset += sizeof(char32_t);
-	}
-
-	return chars;
+	return vfs_write(fildes, &posix_pos[fildes], str, size, &wr);
 }
 
@@ -285,6 +250,5 @@
 {
 	printf_spec_t spec = {
-		.str_write = _dprintf_str_write,
-		.wstr_write = _dprintf_wstr_write,
+		.write = _dprintf_str_write,
 		.data = &fildes
 	};
