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

##### Functions

    getservbyname     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[] = "@(#)getservbyname.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: getservbyname(name, proto)
      17:     char *name, *proto;
      18: {
      19:     register struct servent *p;
      20:     register char **cp;
      21:
      22:     setservent(_serv_stayopen);
      23:     while (p = getservent()) {
      24:         if (strcmp(name, p->s_name) == 0)
      25:             goto gotname;
      26:         for (cp = p->s_aliases; *cp; cp++)
      27:             if (strcmp(name, *cp) == 0)
      28:                 goto gotname;
      29:         continue;
      30: gotname:
      31:         if (proto == 0 || strcmp(p->s_proto, proto) == 0)
      32:             break;
      33:     }
      34:     if (!_serv_stayopen)
      35:         endservent();
      36:     return (p);
      37: }

#### Defined functions

getservbyname defined in line 15; used 53 times

- in /usr/include/netdb.h line 59
- in /usr/src/bin/date.c line 261
- in /usr/src/bin/mail.c line 581
- in /usr/src/bin/rcp.c line 79-86(3), 334
- in /usr/src/include/netdb.h line 57
- in /usr/src/libexec/identd/src/identd.c line 578
- in /usr/src/libexec/telnetd/telnetd.c line 120
- in /usr/src/new/nntp/common/clientlib.c line 176, 183
- in /usr/src/new/nntp/server/netaux.c line 104
- in /usr/src/new/nntp/xfer/nntpxfer.c line 177
- in /usr/src/new/nntp/xmit/get_tcp_conn.c line 261
- in /usr/src/sbin/dump/dumprmt.c line 96
- in /usr/src/sbin/routed/main.c line 47
- in /usr/src/sbin/routed/tools/query.c line 116
- in /usr/src/sbin/routed/tools/trace.c line 75
- in /usr/src/ucb/PORT/systat/netcmds.c line 91
- in /usr/src/ucb/finger/net.c line 64
- in /usr/src/ucb/ftp/main.c line 57
- in /usr/src/ucb/rdist/docmd.c line 204
- in /usr/src/ucb/rlogin.c line 123
- in /usr/src/ucb/rsh.c line 135
- in /usr/src/ucb/talk/get_addrs.c line 46
- in /usr/src/ucb/telnet.c line 2059, 2318
- in /usr/src/ucb/tftp/main.c line 122
- in /usr/src/ucb/tn3270/tn3270.c line 178
- in /usr/src/ucb/whois.c line 66
- in /usr/src/usr.bin/uucp/aculib/bsdtcp.c line 28
- in /usr/src/usr.bin/uucp/uucpd.c line 72
- in /usr/src/usr.sbin/gettable/gettable.c line 56
- in /usr/src/usr.sbin/inetd/inetd.c line 553
- in /usr/src/usr.sbin/lpr/common.c line 86
- in /usr/src/usr.sbin/lpr/lpd.c line 166
- in /usr/src/usr.sbin/named/tools/nslookup/list.c line 841
- in /usr/src/usr.sbin/ntp/ntp.c line 150
- in /usr/src/usr.sbin/ntp/ntpd.c line 311
- in /usr/src/usr.sbin/ntp/ntpdc.c line 280
- in /usr/src/usr.sbin/rwhod/rwhod.c line 84
- in /usr/src/usr.sbin/sendmail.MX/aux/mconnect.c line 62
- in /usr/src/usr.sbin/sendmail.MX/src/daemon.c line 94, 358
- in /usr/src/usr.sbin/sendmail/aux/mconnect.c line 59
- in /usr/src/usr.sbin/sendmail/src/daemon.c line 94, 358
- in /usr/src/usr.sbin/syslogd/syslogd.c line 255
- in /usr/src/usr.sbin/timed/cmds.c line 134, 215, 275
- in /usr/src/usr.sbin/timed/timed.c line 175

#### 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: 584 |