diff --git a/components/libc/compilers/common/SConscript b/components/libc/compilers/common/SConscript index 7979e20944..deadacb426 100644 --- a/components/libc/compilers/common/SConscript +++ b/components/libc/compilers/common/SConscript @@ -13,6 +13,9 @@ else: if GetDepend('RT_LIBC_USING_TIME'): src += ['time.c'] +if GetDepend('RT_USING_POSIX') == False: + SrcRemove(src, ['unistd.c']) + group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH) Return('group') diff --git a/components/libc/compilers/common/unistd.c b/components/libc/compilers/common/unistd.c index e2f2827beb..4068fc5cf5 100644 --- a/components/libc/compilers/common/unistd.c +++ b/components/libc/compilers/common/unistd.c @@ -8,12 +8,11 @@ * 2020-09-01 Meco Man First Version */ -#include #include -#ifdef RT_USING_POSIX - #ifdef RT_USING_POSIX_TERMIOS +#include + int isatty(int fd) { struct termios ts; @@ -25,5 +24,3 @@ char *ttyname(int fd) { return "/dev/tty0"; /*TODO: need to add more specific*/ } - -#endif