Luna/libc/src/init.cpp
apio a3ed950be8
All checks were successful
continuous-integration/drone/pr Build is passing
libc: Basic write buffers
2023-07-22 00:04:27 +02:00

24 lines
525 B
C++

#include <luna/Ignore.h>
#include <stdio.h>
#include <unistd.h>
extern char** environ;
extern "C" FILE* _fdopen_impl(int, const char*, int);
extern "C" void _init_stdio();
extern "C"
{
void libc_init(int argc, char** argv, int envc, char** envp)
{
ignore(argc, argv, envc);
environ = envp;
_init_stdio();
stdin = _fdopen_impl(STDIN_FILENO, "r", _IOLBF);
stdout = _fdopen_impl(STDOUT_FILENO, "w", _IOLBF);
stderr = _fdopen_impl(STDERR_FILENO, "w", _IONBF);
}
}