xref: /original-bsd/lib/libc/net/getproto.c (revision dcaa9859)
1 /*	getproto.c	4.1	82/08/25	*/
2 
3 #include <netdb.h>
4 
5 struct protoent *
6 getproto(proto)
7 	register int proto;
8 {
9 	register struct protoent *p;
10 
11 	setprotoent(0);
12 	while (p = getprotoent())
13 		if (p->p_proto == proto)
14 			break;
15 	endprotoent();
16 	return (p);
17 }
18