projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix nl_langinfo table for LC_TIME era-related items
[musl]
/
src
/
unistd
/
ttyname_r.c
diff --git
a/src/unistd/ttyname_r.c
b/src/unistd/ttyname_r.c
index
2255e2d
..
8bac7b2
100644
(file)
--- a/
src/unistd/ttyname_r.c
+++ b/
src/unistd/ttyname_r.c
@@
-1,7
+1,7
@@
#include <unistd.h>
#include <errno.h>
#include <unistd.h>
#include <errno.h>
-#include <stdio.h>
-#include <string.h>
+
+void __procfdname(char *, unsigned);
int ttyname_r(int fd, char *name, size_t size)
{
int ttyname_r(int fd, char *name, size_t size)
{
@@
-10,7
+10,7
@@
int ttyname_r(int fd, char *name, size_t size)
if (!isatty(fd)) return ENOTTY;
if (!isatty(fd)) return ENOTTY;
-
snprintf(procname, sizeof procname, "/proc/self/fd/%d"
, fd);
+
__procfdname(procname
, fd);
l = readlink(procname, name, size);
if (l < 0) return errno;
l = readlink(procname, name, size);
if (l < 0) return errno;