OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [tcpip/] [current/] [doc/] [getserv.man] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
NAME
2
       getservent, getservbyname, getservbyport - get service entry
3
 
4
SYNOPSIS
5
       #include <network.h>
6
 
7
       struct servent *getservbyname(const char *name, const char *proto);
8
 
9
       struct servent *getservbyport(int port, const char *proto);
10
 
11
DESCRIPTION
12
       The  getservbyname()  function returns a servent structure
13
       for the line from /etc/services that matches  the  service
14
       name using protocol proto.
15
 
16
       The  getservbyport()  function returns a servent structure
17
       for the line that matches the port port given  in  network
18
       byte order using protocol proto.
19
 
20
       The servent structure is defined in <netdb.h> as follows:
21
 
22
              struct servent {
23
                      char    *s_name;        /* official service name */
24
                      char    **s_aliases;    /* alias list */
25
                      int     s_port;         /* port number */
26
                      char    *s_proto;       /* protocol to use */
27
              }
28
 
29
       The members of the servent structure are:
30
 
31
       s_name The official name of the service.
32
 
33
       s_aliases
34
              A zero terminated list of alternative names for the
35
              service.
36
 
37
       s_port The  port  number  for the service given in network
38
              byte order.
39
 
40
       s_proto
41
              The name of the protocol to use with this  service.
42
 
43
RETURN VALUE
44
       The   getservbyname()  and  getservbyport()
45
       functions return the servent structure, or a NULL  pointer
46
       if an error occurs.
47
 
48
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.