what were before one extern FILE* without reference now are opened by libc on program initialization, to point to /dev/console by default.
14 lines
311 B
C++
14 lines
311 B
C++
#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);
|
|
} |