refactor: restructure the user space stuff.
[lunaix-os.git] / lunaix-os / usr / libc / src / printf.c
diff --git a/lunaix-os/usr/libc/src/printf.c b/lunaix-os/usr/libc/src/printf.c
new file mode 100644 (file)
index 0000000..3268a3f
--- /dev/null
@@ -0,0 +1,15 @@
+#include "_mystdio.h"
+#include <stdio.h>
+#include <unistd.h>
+
+int
+printf(const char* fmt, ...)
+{
+    char buf[1024];
+    va_list args;
+    va_start(args, fmt);
+    int n = __vprintf_internal(buf, fmt, 1024, args);
+    va_end(args);
+
+    return write(stdout, buf, n);
+}
\ No newline at end of file