xref: /original-bsd/lib/libc/net/getproto.c (revision 6b7db209)
1 /*	getproto.c	4.2	82/10/05	*/
2 
3 #include <netdb.h>
4 
5 struct protoent *
6 getprotobynumber(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