From 3ae251a204748a2f1c4c2af6c55e73d5e5159d0f Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Tue, 24 Oct 2023 13:50:36 +0200 Subject: LibC: Allocate stdin, stdout, stderr on the heap so they can be closed with fclose --- userland/libc/include/stdio.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'userland/libc/include') diff --git a/userland/libc/include/stdio.h b/userland/libc/include/stdio.h index 22afbb2..94ac9dc 100644 --- a/userland/libc/include/stdio.h +++ b/userland/libc/include/stdio.h @@ -48,14 +48,13 @@ typedef struct { int fd; } FILE_FD_COOKIE; -extern FILE __stdin_FILE; -extern FILE __stdout_FILE; -extern FILE __stderr_FILE; +extern FILE *__stdin_FILE; +extern FILE *__stdout_FILE; +extern FILE *__stderr_FILE; -#define stdin (&__stdin_FILE) -#define stdout (&__stdout_FILE) -//#define stderr (&__stderr_FILE) -#define stderr (&__stdout_FILE) +#define stdin __stdin_FILE +#define stdout __stdout_FILE +#define stderr __stderr_FILE typedef int mode_t; -- cgit v1.2.3