# 2.11BSD#431 - /usr/src/lib/libc/net/getsbyport.c

##### Functions

    getservbyport     X

       1: /*
       2:  * Copyright (c) 1983 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #if defined(LIBC_SCCS) && !defined(lint)
       8: static char sccsid[] = "@(#)getservbyport.c	5.3 (Berkeley) 5/19/86";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include <netdb.h>
      12:
      13: extern int _serv_stayopen;
      14:
      15: struct servent *
      16: getservbyport(port, proto)
      17:     int port;
      18:     char *proto;
      19: {
      20:     register struct servent *p;
      21:
      22:     setservent(_serv_stayopen);
      23:     while (p = getservent()) {
      24:         if (p->s_port != port)
      25:             continue;
      26:         if (proto == 0 || strcmp(p->s_proto, proto) == 0)
      27:             break;
      28:     }
      29:     if (!_serv_stayopen)
      30:         endservent();
      31:     return (p);
      32: }

#### Defined functions

getservbyport defined in line 15; used 8 times

- in /usr/include/netdb.h line 59
- in /usr/src/include/netdb.h line 57
- in /usr/src/new/crash/inet.c line 343
- in /usr/src/ucb/PORT/systat/netcmds.c line 190
- in /usr/src/ucb/PORT/systat/netstat.c line 331
- in /usr/src/ucb/netstat/inet.c line 358
- in /usr/src/usr.sbin/named/tools/nslookup/debug.c line 413
- in /usr/src/usr.sbin/named/tools/nslookup/list.c line 752

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1987-08-06 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 485 |