summaryrefslogtreecommitdiff
path: root/libc/termios/ttyname.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/termios/ttyname.c')
-rw-r--r--libc/termios/ttyname.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c
index 15093f8a5..43005a63a 100644
--- a/libc/termios/ttyname.c
+++ b/libc/termios/ttyname.c
@@ -26,13 +26,6 @@
*/
#define TTYNAME_BUFLEN 32
-char *ttyname(int fd)
-{
- static char name[TTYNAME_BUFLEN];
-
- return ttyname_r(fd, name, TTYNAME_BUFLEN) ? NULL : name;
-}
-
static const char dirlist[] =
/* 12345670123 */
"\010/dev/vc/\0" /* Try /dev/vc first (be devfs compatible) */
@@ -41,7 +34,7 @@ static const char dirlist[] =
"\011/dev/pts/\0" /* and try /dev/pts next */
"\005/dev/\0"; /* and try walking through /dev last */
-int ttyname_r(int fd, char *ubuf, size_t ubuflen)
+int attribute_hidden __ttyname_r(int fd, char *ubuf, size_t ubuflen)
{
struct dirent *d;
struct stat st;
@@ -116,3 +109,11 @@ int ttyname_r(int fd, char *ubuf, size_t ubuflen)
return rv;
}
+strong_alias(__ttyname_r,ttyname_r)
+
+char *ttyname(int fd)
+{
+ static char name[TTYNAME_BUFLEN];
+
+ return __ttyname_r(fd, name, TTYNAME_BUFLEN) ? NULL : name;
+}