diff --git a/libs/libc/src/luna.cpp b/libs/libc/src/luna.cpp index eee9f2ae..7d031cdb 100644 --- a/libs/libc/src/luna.cpp +++ b/libs/libc/src/luna.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -20,7 +21,7 @@ extern "C" noreturn void __luna_abort(const char* message) { - syscall(SYS_write, message, strlen(message)); + fwrite(message, strlen(message), 1, stdout); abort(); } } \ No newline at end of file diff --git a/libs/libc/src/stdio.cpp b/libs/libc/src/stdio.cpp index c19aff27..c7604a98 100644 --- a/libs/libc/src/stdio.cpp +++ b/libs/libc/src/stdio.cpp @@ -10,9 +10,9 @@ extern "C" { int puts(const char* s) { - long nwritten = syscall(SYS_write, s, strlen(s)); + long nwritten = fwrite(s, strlen(s), 1, stdout); if (nwritten < 0) return -1; - nwritten += syscall(SYS_write, "\n", 1); + nwritten += fwrite("\n", 1, 1, stdout); return (int)nwritten; } void perror(const char* s) // FIXME: Print to stderr, whenever we have an stderr.