libc: Implement ttyname and ttyname_r

Note: this patch can get file path from root pseudo file handle,
but a general infrastructure is setup for other file system too.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86cd79ebb741f2f43fdd398bb7498c40687d949b
This commit is contained in:
Xiang Xiao 2021-07-08 11:11:28 +08:00 committed by Gustavo Henrique Nihei
parent b7653e2fae
commit 2fa1e55628
12 changed files with 264 additions and 2 deletions

View file

@ -322,6 +322,9 @@ int ftruncate(int fd, off_t length);
/* Check if a file descriptor corresponds to a terminal I/O file */
int isatty(int fd);
FAR char *ttyname(int fd);
int ttyname_r(int fd, FAR char *buf, size_t buflen);
#endif
/* Memory management */