xref: /onnv-gate/usr/src/lib/libbc/libc/gen/common/getttynam.c (revision 0:68f95e015346)
1*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
2*0Sstevel@tonic-gate 	  /* from UCB 5.2 3/9/86 */
3*0Sstevel@tonic-gate /*
4*0Sstevel@tonic-gate  * Copyright (c) 1983 Regents of the University of California.
5*0Sstevel@tonic-gate  * All rights reserved.  The Berkeley software License Agreement
6*0Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
7*0Sstevel@tonic-gate  */
8*0Sstevel@tonic-gate 
9*0Sstevel@tonic-gate #include <ttyent.h>
10*0Sstevel@tonic-gate 
11*0Sstevel@tonic-gate struct ttyent *
getttynam(tty)12*0Sstevel@tonic-gate getttynam(tty)
13*0Sstevel@tonic-gate 	char *tty;
14*0Sstevel@tonic-gate {
15*0Sstevel@tonic-gate 	register struct ttyent *t;
16*0Sstevel@tonic-gate 
17*0Sstevel@tonic-gate 	setttyent();
18*0Sstevel@tonic-gate 	while (t = getttyent()) {
19*0Sstevel@tonic-gate 		if (strcmp(tty, t->ty_name) == 0)
20*0Sstevel@tonic-gate 			break;
21*0Sstevel@tonic-gate 	}
22*0Sstevel@tonic-gate 	endttyent();
23*0Sstevel@tonic-gate 	return (t);
24*0Sstevel@tonic-gate }
25