|
|
1.1 ! root 1: /* getservbyport.c 4.2 82/10/05 */ ! 2: ! 3: #include <netdb.h> ! 4: ! 5: struct servent * ! 6: getservbyport(port, proto) ! 7: int port; ! 8: char *proto; ! 9: { ! 10: register struct servent *p; ! 11: ! 12: setservent(0); ! 13: while (p = getservent()) { ! 14: if (p->s_port != port) ! 15: continue; ! 16: if (proto == 0 || strcmp(p->s_proto, proto) == 0) ! 17: break; ! 18: } ! 19: endservent(); ! 20: return (p); ! 21: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.