From a10aabfcd52f702057316018cd7847ab2bfe4aa1 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Tue, 26 May 2026 21:32:27 +0000 Subject: we're bringing kjarna back and not doing the crazy stuff with trying to have task management during efi. that was a bit extra. --- lib/libc/stdio.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/libc/stdio.c (limited to 'lib/libc/stdio.c') diff --git a/lib/libc/stdio.c b/lib/libc/stdio.c new file mode 100644 index 0000000..70cc685 --- /dev/null +++ b/lib/libc/stdio.c @@ -0,0 +1,30 @@ +#include +#include +#include + +struct FILE +{ + int fd; +}; + +static FILE stdin_stream = { STDIN_FILENO }; +static FILE stdout_stream = { STDOUT_FILENO }; +static FILE stderr_stream = { STDERR_FILENO }; + +FILE *stdin = &stdin_stream; +FILE *stdout = &stdout_stream; +FILE *stderr = &stderr_stream; + +int fputc(int c, FILE *f) +{ + write(f->fd, (const char *)&c, 1); + return 1; +} + +int fputs(const char *s, FILE *f) +{ + size_t slen = strlen(s); + write(f->fd, s, slen); + return (int)slen; +} + -- cgit v1.3.1-1-g115d