diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/getttyent.c | 29 | ||||
-rw-r--r-- | misc/ttyslot.c | 8 |
2 files changed, 20 insertions, 17 deletions
diff --git a/misc/getttyent.c b/misc/getttyent.c index 864f65f..fcdbc22 100644 --- a/misc/getttyent.c +++ b/misc/getttyent.c @@ -44,24 +44,24 @@ static char zapchar; static FILE *tf; struct ttyent * -getttynam(tty) - const char *tty; +__getttynam (const char *tty) { struct ttyent *t; - setttyent(); - while ((t = getttyent())) + __setttyent(); + while ((t = __getttyent())) if (!strcmp(tty, t->ty_name)) break; - endttyent(); + __endttyent(); return (t); } +weak_alias (__getttynam, getttynam) static char *skip (char *) __THROW internal_function; static char *value (char *) __THROW internal_function; struct ttyent * -getttyent (void) +__getttyent (void) { static struct ttyent tty; int c; @@ -69,11 +69,11 @@ getttyent (void) #define MAXLINELENGTH 100 static char line[MAXLINELENGTH]; - if (!tf && !setttyent()) + if (!tf && !__setttyent()) return (NULL); flockfile (tf); for (;;) { - if (!fgets_unlocked(p = line, sizeof(line), tf)) { + if (!__fgets_unlocked(p = line, sizeof(line), tf)) { funlockfile (tf); return (NULL); } @@ -131,7 +131,8 @@ getttyent (void) *p = '\0'; return (&tty); } -libc_hidden_def (getttyent) +libc_hidden_def (__getttyent) +weak_alias (__getttyent, getttyent) #define QUOTED 1 @@ -184,7 +185,7 @@ value(p) } int -setttyent (void) +__setttyent (void) { if (tf) { @@ -197,10 +198,11 @@ setttyent (void) } return (0); } -libc_hidden_def (setttyent) +libc_hidden_def (__setttyent) +weak_alias (__setttyent, setttyent) int -endttyent (void) +__endttyent (void) { int rval; @@ -211,4 +213,5 @@ endttyent (void) } return (1); } -libc_hidden_def (endttyent) +libc_hidden_def (__endttyent) +weak_alias (__endttyent, endttyent) diff --git a/misc/ttyslot.c b/misc/ttyslot.c index 9c69589..0ed14d7 100644 --- a/misc/ttyslot.c +++ b/misc/ttyslot.c @@ -53,20 +53,20 @@ ttyslot (void) name = __alloca (buflen); - setttyent(); + __setttyent(); for (cnt = 0; cnt < 3; ++cnt) if (__ttyname_r (cnt, name, buflen) == 0) { if ((p = rindex(name, '/'))) ++p; else p = name; - for (slot = 1; (ttyp = getttyent()); ++slot) + for (slot = 1; (ttyp = __getttyent()); ++slot) if (!strcmp(ttyp->ty_name, p)) { - endttyent(); + __endttyent(); return(slot); } break; } - endttyent(); + __endttyent(); return(0); } |