mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-19 12:14:30 +08:00
[posix][libc] 优化libc中posix结构
This commit is contained in:
@@ -7,29 +7,24 @@
|
||||
* Date Author Notes
|
||||
* 2017/10/15 bernard the first version
|
||||
*/
|
||||
#include <fcntl.h>
|
||||
#include <rtthread.h>
|
||||
#include <fcntl.h>
|
||||
#include "libc.h"
|
||||
|
||||
#ifdef RT_USING_PTHREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
int libc_system_init(void)
|
||||
{
|
||||
#if defined(RT_USING_DFS) && defined(RT_USING_DFS_DEVFS)
|
||||
#ifdef RT_USING_POSIX
|
||||
rt_device_t dev_console;
|
||||
|
||||
dev_console = rt_console_get_device();
|
||||
if (dev_console)
|
||||
{
|
||||
#if defined(RT_USING_POSIX)
|
||||
libc_stdio_set_console(dev_console->parent.name, O_RDWR);
|
||||
#else
|
||||
libc_stdio_set_console(dev_console->parent.name, O_WRONLY);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif /* RT_USING_POSIX */
|
||||
|
||||
#if defined (RT_USING_PTHREADS) && !defined (RT_USING_COMPONENTS_INIT)
|
||||
pthread_system_init();
|
||||
@@ -38,4 +33,3 @@ int libc_system_init(void)
|
||||
return 0;
|
||||
}
|
||||
INIT_COMPONENT_EXPORT(libc_system_init);
|
||||
|
||||
|
Reference in New Issue
Block a user