void init_console()

in init/init.c [259:270]


void init_console() {
    // init process needs to set up a tty for the container and this is likely
    // not the correct way to do this, although it works when compiling with
    // musl-gcc.
    const char *console_path = "/dev/console";
    die_on(freopen(console_path, "r", stdin) == NULL,
           "freopen failed for stdin");
    die_on(freopen(console_path, "w", stdout) == NULL,
           "freopen failed for stdout");
    die_on(freopen(console_path, "w", stderr) == NULL,
           "freopen failed for stderr");
}