summaryrefslogtreecommitdiff
path: root/components/libc/compilers/dlib/syscall_write.c
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-09-21 12:51:26 -0400
committerMeco Man <[email protected]>2021-09-21 12:51:26 -0400
commitc8c632512aa6c87211871fe0a85e77b72d4ebe06 (patch)
treeb6d51850cf0b940973a670ece8341ec469c85693 /components/libc/compilers/dlib/syscall_write.c
parent13b0b60b1466b4a3eae34b5437ff35432de32c5e (diff)
[libc][syscall]移除libc_stdio_read/write函数,优化syscall
Diffstat (limited to 'components/libc/compilers/dlib/syscall_write.c')
-rw-r--r--components/libc/compilers/dlib/syscall_write.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/components/libc/compilers/dlib/syscall_write.c b/components/libc/compilers/dlib/syscall_write.c
index de464530b8..a5462653bf 100644
--- a/components/libc/compilers/dlib/syscall_write.c
+++ b/components/libc/compilers/dlib/syscall_write.c
@@ -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;