aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/src/main.c')
-rw-r--r--lib/libc/src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libc/src/main.c b/lib/libc/src/main.c
index 477842b..890f3c8 100644
--- a/lib/libc/src/main.c
+++ b/lib/libc/src/main.c
@@ -28,9 +28,13 @@
*/
#include <stdint.h>
+#include <stdio.h>
+#include <unistd.h>
int main(int argc, const char **argv, const char **envp);
+FILE *stdout;
+
int
__libc_entry(uint64_t *ctx)
{
@@ -38,5 +42,7 @@ __libc_entry(uint64_t *ctx)
const char **argv = (const char **)(ctx + 1);
const char **envp = (const char **)(argv + argc + 1);
+ stdout = fdopen(STDOUT_FILENO, "a");
+
return main(argc, argv, envp);
}