LibC: puts() now just calls syscall(SYS_WRITE, ...)

This commit is contained in:
Bananymous 2023-04-22 15:29:38 +03:00
parent 1b4c744974
commit c15f031c3f
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h> #include <unistd.h>
struct FILE struct FILE
@ -86,7 +88,7 @@ int putchar(int ch)
int puts(const char* str) int puts(const char* str)
{ {
return printf("%s", str); return syscall(SYS_WRITE, STDOUT_FILENO, str, strlen(str));
} }
int sprintf(char* __restrict__ stream, const char* __restrict__ format, ...) int sprintf(char* __restrict__ stream, const char* __restrict__ format, ...)