xref: /csrg-svn/lib/libc/gen/getttynam.c (revision 26563)
121344Sdist /*
221344Sdist  * Copyright (c) 1983 Regents of the University of California.
321344Sdist  * All rights reserved.  The Berkeley software License Agreement
421344Sdist  * specifies the terms and conditions for redistribution.
521344Sdist  */
616421Sralph 
7*26563Sdonn #if defined(LIBC_SCCS) && !defined(lint)
8*26563Sdonn static char sccsid[] = "@(#)getttynam.c	5.2 (Berkeley) 03/09/86";
9*26563Sdonn #endif LIBC_SCCS and not lint
1021344Sdist 
1116421Sralph #include <ttyent.h>
1216421Sralph 
1316421Sralph struct ttyent *
getttynam(tty)1416421Sralph getttynam(tty)
1516421Sralph 	char *tty;
1616421Sralph {
1716421Sralph 	register struct ttyent *t;
1816421Sralph 
1916421Sralph 	setttyent();
2016421Sralph 	while (t = getttyent()) {
2116421Sralph 		if (strcmp(tty, t->ty_name) == 0)
2216421Sralph 			break;
2316421Sralph 	}
2416421Sralph 	endttyent();
2516421Sralph 	return (t);
2616421Sralph }
27