Luna/libs/libc/src/init.cpp

14 lines
311 B
C++
Raw Normal View History

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
extern "C" void initialize_libc()
{
__stderr = fopen("/dev/console", "rw");
if (!stderr) exit(errno);
__stdout = fopen("/dev/console", "rw");
if (!stdout) exit(errno);
clearerr(__stderr);
clearerr(__stdout);
}