summaryrefslogtreecommitdiff
path: root/components/libc/newlib/syscalls.c
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-10-22 10:20:38 +0000
committerbernard.xiong <[email protected]>2010-10-22 10:20:38 +0000
commita6f06d24cfec32dddee27a1ce61920fc4007d68a (patch)
tree7358e8edb966c99549dc264def493e9550070d61 /components/libc/newlib/syscalls.c
parent363ad228a434f7b06cfa7170cf390c1177d731dc (diff)
add stdin, stdout, stderr implementation in newlib.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1029 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/libc/newlib/syscalls.c')
-rw-r--r--components/libc/newlib/syscalls.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/components/libc/newlib/syscalls.c b/components/libc/newlib/syscalls.c
index 3625f2d234..93d96fe165 100644
--- a/components/libc/newlib/syscalls.c
+++ b/components/libc/newlib/syscalls.c
@@ -51,6 +51,8 @@ _getpid_r(struct _reent *ptr)
int
_isatty_r(struct _reent *ptr, int fd)
{
+ if (fd >=0 && fd < 3) return 1;
+
/* return "not supported" */
ptr->_errno = ENOTSUP;
return -1;
@@ -198,3 +200,18 @@ _free_r (struct _reent *ptr, void *addr)
{
rt_free (addr);
}
+
+#ifdef RT_USING_FINSH
+#include <finsh.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+void nltest()
+{
+ printf("stdout test!!\n");
+ fprintf(stdout, "fprintf test!!\n");
+ fprintf(stderr, "fprintf test!!\n");
+}
+FINSH_FUNCTION_EXPORT(nltest, newlib test);
+#endif
+