update armlibc/stdio.c
Signed-off-by: yangfasheng <yangfasheng@rt-thread.com>
This commit is contained in:
parent
1abe83531c
commit
f31b11de78
|
@ -65,11 +65,27 @@ int libc_stdio_get_console(void)
|
|||
|
||||
int libc_stdio_read(void *buffer, size_t size)
|
||||
{
|
||||
if (std_fd >= 0)
|
||||
{
|
||||
return read(std_fd, buffer, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("Illegal stdio input!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int libc_stdio_write(const void *buffer, size_t size)
|
||||
{
|
||||
if (std_fd >= 0)
|
||||
{
|
||||
return write(std_fd, buffer, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("Illegal stdio output!\n");
|
||||
return size;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue