summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-09-04 08:49:11 +0800
committerGitHub <[email protected]>2020-09-04 08:49:11 +0800
commit86e4216275ded5f6e2cb28bbc33e754942910173 (patch)
tree8b740b0b3d86edf6b9945ee61af29221ca176652 /components/libc/compilers/common
parentcf442c2c2edf32a41aa309a7d4f702014aa0ac9d (diff)
parent5721fa8990e4178a427564a1e546df507c87c2b4 (diff)
Merge pull request #3869 from mysterywolf/master
[fix/add/bug] 修改armlibc多处,重新提交了[请求优先通过!!]
Diffstat (limited to 'components/libc/compilers/common')
-rw-r--r--components/libc/compilers/common/unistd.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c
new file mode 100644
index 0000000000..04a0886655
--- /dev/null
+++ b/components/libc/compilers/common/unistd.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2006-2018, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2020-09-01 Meco Man First Version
+ */
+
+#include <termios.h>
+#include <unistd.h>
+
+#ifdef RT_USING_POSIX_TERMIOS
+int isatty(int fd)
+{
+ struct termios ts;
+ return(tcgetattr(fd,&ts) != -1);/*true if no error (is a tty)*/
+}
+#endif
+
+char *ttyname(int fd)
+{
+ return "/dev/tty0"; /*TODO: need to add more specific*/
+}