24 lines
525 B
C++
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);
|
|
}
|
|
}
|