ChangeSet 1.914.157.4, 2003/02/15 23:11:51-06:00, greg@kroah.com

klibc: fix up the hello_world example

stdout doesn't go anywhere useful when spawned from the kernel :)


diff -Nru a/usr/root/hello.c b/usr/root/hello.c
--- a/usr/root/hello.c	Wed Feb 19 11:42:24 2003
+++ b/usr/root/hello.c	Wed Feb 19 11:42:24 2003
@@ -1,8 +1,13 @@
 #include <stdio.h>
+#include <fcntl.h>
 
 const char hello[] = "Hi Ma!\n";
 int main (void)
 {
-	fputs("Hi Ma!\n", stdout);
+	int file;
+
+	file = open("/dev/console", O_WRONLY);
+	_fwrite(hello, sizeof(hello)-1, file);
+	close(file);
 	return 0;
 }
