diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-07 16:09:49 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-07 16:09:49 +0000 |
commit | 53b5f21c9c453ff74c9aabdecd166a5e6ddb202b (patch) | |
tree | 7e94f2193471512a521b3675b28a27b829a43707 /libc/termios/ttyname.c | |
parent | 746d0019f275acc0d3752b54e8ae1930a2f5fa3c (diff) |
Hide more
Diffstat (limited to 'libc/termios/ttyname.c')
-rw-r--r-- | libc/termios/ttyname.c | 17 |
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; +} |