mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-05 15:15:29 +00:00
[libc][syscall]移除libc_stdio_read/write函数,优化syscall
This commit is contained in:
@@ -30,19 +30,24 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
|
||||
#else
|
||||
|
||||
#ifdef RT_USING_POSIX
|
||||
return libc_stdio_write((void*)buf, len);
|
||||
return write(STDOUT_FILENO, (void*)buf, len);
|
||||
#else
|
||||
rt_device_t console_device;
|
||||
|
||||
console_device = rt_console_get_device();
|
||||
if (console_device != 0) rt_device_write(console_device, 0, buf, len);
|
||||
if (console_device != 0)
|
||||
{
|
||||
rt_device_write(console_device, 0, buf, len);
|
||||
}
|
||||
|
||||
return len;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
if (handle == _LLIO_STDIN) return _LLIO_ERROR;
|
||||
else if (handle == _LLIO_STDIN)
|
||||
{
|
||||
return _LLIO_ERROR;
|
||||
}
|
||||
|
||||
#ifndef RT_USING_DFS
|
||||
return _LLIO_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user