smart-green-house/rtt-uart-nb/rt-thread/components/libc/compilers/common/unistd.c

27 lines
487 B
C
Raw Permalink Normal View History

2023-10-28 18:00:47 +08:00
/*
* 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 <unistd.h>
#ifdef RT_USING_POSIX_TERMIOS
#include "termios.h"
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*/
}