diff options
| author | Jakob Kaivo <jkk@ung.org> | 2024-01-31 16:44:28 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2024-01-31 16:44:28 -0500 |
| commit | 2bc46bd54cc8cdcd7647461f2d76384266f2a0e4 (patch) | |
| tree | 52b77d68abbe5f971f63d2c82df8e933b831b521 /src/unistd/ttyname.c | |
| parent | a05e8f1436eecb990d68bc1de8ba28721f1f387d (diff) | |
remove unistd
Diffstat (limited to 'src/unistd/ttyname.c')
| -rw-r--r-- | src/unistd/ttyname.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/unistd/ttyname.c b/src/unistd/ttyname.c deleted file mode 100644 index be66ccc0..00000000 --- a/src/unistd/ttyname.c +++ /dev/null @@ -1,35 +0,0 @@ -#if 0 - -#include <sys/types.h> -#include <unistd.h> -#include <limits.h> -#include <stdio.h> -#include "_unistd.h" -#include "_syscall.h" - -#ifndef readlink -#define readlink(_path, _buf, _bufsiz) __scall3(readlink, _path, _buf, _bufsiz) -#endif - -char *ttyname(int fildes) -{ - char path[PATH_MAX + 1]; - static char __ttyname[PATH_MAX + 1]; - - if (!isatty(fildes)) { - return NULL; - } - - sprintf(path, "/proc/self/fd/%d", fildes); - if (readlink(path, __ttyname, sizeof(__ttyname)) == -1) { - return NULL; - } - - return __ttyname; -} -/* -POSIX(1) -*/ - - -#endif |
