Index: uspace/lib/libc/generic/io/stream.c
===================================================================
--- uspace/lib/libc/generic/io/stream.c	(revision 663c5a6102b84e639dc1cdff414940e7475ed742)
+++ uspace/lib/libc/generic/io/stream.c	(revision ba661bce010ad734a46440fd01290bea8981f2e4)
@@ -57,45 +57,39 @@
 ssize_t read_stdin(void *buf, size_t count)
 {
-	ipcarg_t r0, r1;
-	size_t i = 0;
-
-	while (i < count) {
-		if (async_req_0_2(console_phone, CONSOLE_GETCHAR, &r0,
-		    &r1) < 0) {
-			return -1;
+	open_console();
+	if (console_phone >= 0) {
+		ipcarg_t r0, r1;
+		size_t i = 0;
+	
+		while (i < count) {
+			if (async_req_0_2(console_phone, CONSOLE_GETCHAR, &r0, &r1) < 0)
+				return -1;
+			((char *) buf)[i++] = r0;
 		}
-		((char *) buf)[i++] = r0;
+		return i;
 	}
-	return i;
 }
 
 ssize_t write_stdout(const void *buf, size_t count)
 {
-	int i;
-
-	for (i = 0; i < count; i++)
-		async_msg_1(console_phone, CONSOLE_PUTCHAR,
-		    ((const char *) buf)[i]);
+	open_console();
+	if (console_phone >= 0) {
+		int i;
 	
-	return count;
+		for (i = 0; i < count; i++)
+			async_msg_1(console_phone, CONSOLE_PUTCHAR,
+			    ((const char *) buf)[i]);
+		
+		return count;
+	} else
+		return __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, count);
 }
 
-void open_stdin(void)
+void open_console(void)
 {
 	if (console_phone < 0) {
-		while ((console_phone = ipc_connect_me_to(PHONE_NS,
-		    SERVICE_CONSOLE, 0, 0)) < 0) {
-			usleep(10000);
-		}
-	}
-}
-
-void open_stdout(void)
-{
-	if (console_phone < 0) {
-		while ((console_phone = ipc_connect_me_to(PHONE_NS,
-		    SERVICE_CONSOLE, 0, 0)) < 0) {
-			usleep(10000);
-		}
+		int phone = ipc_connect_me_to(PHONE_NS, SERVICE_CONSOLE, 0, 0);
+		if (phone >= 0)
+			console_phone = phone;
 	}
 }
@@ -103,4 +97,5 @@
 int get_cons_phone(void)
 {
+	open_console();
 	return console_phone;
 }
Index: uspace/lib/libc/include/io/stream.h
===================================================================
--- uspace/lib/libc/include/io/stream.h	(revision 663c5a6102b84e639dc1cdff414940e7475ed742)
+++ uspace/lib/libc/include/io/stream.h	(revision ba661bce010ad734a46440fd01290bea8981f2e4)
@@ -40,6 +40,5 @@
 #define EMFILE -17
 
-extern void open_stdin(void);
-extern void open_stdout(void);
+extern void open_console(void);
 
 extern ssize_t read_stdin(void *, size_t);
