mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-18 18:34:20 +08:00

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1029 bbd45198-f89e-11dd-88c7-29a3b14d5316
21 lines
529 B
C
21 lines
529 B
C
#include <rtthread.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <fcntl.h>
|
|
|
|
void libc_system_init(const char* tty_name)
|
|
{
|
|
int fd;
|
|
|
|
/* init console device */
|
|
rt_console_init(tty_name);
|
|
|
|
/* open console as stdin/stdout/stderr */
|
|
fd = open("/dev/console", O_RDONLY, 0); /* for stdin */
|
|
rt_kprintf("stdin: %d\n", fd);
|
|
fd = open("/dev/console", O_WRONLY, 0); /* for stdout */
|
|
rt_kprintf("stdout: %d\n", fd);
|
|
fd = open("/dev/console", O_WRONLY, 0); /* for stderr */
|
|
rt_kprintf("stderr: %d\n", fd);
|
|
}
|