xref: /csrg-svn/lib/libc/net/getproto.c (revision 8324)
1*8324Ssam /*	getproto.c	4.2	82/10/05	*/
27898Ssam 
37898Ssam #include <netdb.h>
47898Ssam 
57898Ssam struct protoent *
6*8324Ssam getprotobynumber(proto)
77898Ssam 	register int proto;
87898Ssam {
97898Ssam 	register struct protoent *p;
107898Ssam 
117898Ssam 	setprotoent(0);
127898Ssam 	while (p = getprotoent())
137898Ssam 		if (p->p_proto == proto)
147898Ssam 			break;
157898Ssam 	endprotoent();
167898Ssam 	return (p);
177898Ssam }
18