summaryrefslogtreecommitdiff
path: root/components/libc/compilers/armlibc/unistd.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/libc/compilers/armlibc/unistd.c')
-rw-r--r--components/libc/compilers/armlibc/unistd.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/components/libc/compilers/armlibc/unistd.c b/components/libc/compilers/armlibc/unistd.c
new file mode 100644
index 0000000000..e2f2827beb
--- /dev/null
+++ b/components/libc/compilers/armlibc/unistd.c
@@ -0,0 +1,29 @@
+/*
+ * 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
+
+#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*/
+}
+
+#endif