xref: /csrg-svn/lib/libc/gen/getttynam.c (revision 16421)
1*16421Sralph /* @(#)getttynam.c	4.1 (Berkeley) 04/27/84 */
2*16421Sralph 
3*16421Sralph #include <ttyent.h>
4*16421Sralph 
5*16421Sralph struct ttyent *
6*16421Sralph getttynam(tty)
7*16421Sralph 	char *tty;
8*16421Sralph {
9*16421Sralph 	register struct ttyent *t;
10*16421Sralph 
11*16421Sralph 	setttyent();
12*16421Sralph 	while (t = getttyent()) {
13*16421Sralph 		if (strcmp(tty, t->ty_name) == 0)
14*16421Sralph 			break;
15*16421Sralph 	}
16*16421Sralph 	endttyent();
17*16421Sralph 	return (t);
18*16421Sralph }
19