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
+1
View File
@@ -95,6 +95,7 @@
#define F_SETLKW 12 /* Like F_SETLK, but wait for lock to become available */
#define F_SETOWN 13 /* Set pid that will receive SIGIO and SIGURG signals for fd */
#define F_SETSIG 14 /* Set the signal to be sent */
#define F_GETPATH 15 /* Get the path of the file descriptor(BSD/macOS) */
/* For posix fcntl() and lockf() */