增加unistd.c文件

This commit is contained in:
mysterywolf 2020-09-02 10:22:47 +08:00
parent 9b470d448d
commit 837604553b
2 changed files with 26 additions and 0 deletions

View File

@ -7,3 +7,4 @@
* Date Author Notes
*/
#include "sys/unistd.h"

View File

@ -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*/
}