purge socketaddr call in favor of getsockname
[unix-history] / usr / src / lib / libc / net / getprotoname.c
CommitLineData
5e649950 1/* getprotoname.c 4.2 82/10/05 */
723e6dff
SL
2
3#include <netdb.h>
4
5struct protoent *
5e649950 6getprotobyname(name)
723e6dff
SL
7 register char *name;
8{
9 register struct protoent *p;
10 register char **cp;
11
12 setprotoent(0);
13 while (p = getprotoent()) {
14 if (strcmp(p->p_name, name) == 0)
15 break;
16 for (cp = p->p_aliases; *cp != 0; cp++)
17 if (strcmp(*cp, name) == 0)
18 goto found;
19 }
20found:
21 endprotoent();
22 return (p);
23}