ggeettsseerrvveenntt() -- Sockets Function (libsocket)

Get a service entry
#iinncclluuddee <nneettddbb.hh>
ssttrruucctt sseerrvveenntt *ggeettsseerrvveenntt();

Function ggeettsseerrvveenntt()  reads the next entry  from file /eettcc/sseerrvviicceess, which
describes  the  services  offered by  TCP/IP  on  your  local network.   If
necessary, it opens the file.  It  returns a pointer to a structure of type
sseerrvveenntt, which is defined in header file <nneettddbb.hh>:

struct servent {
    char *s_name;   /* official name of service */
    char **s_aliases;   /* alias list */
    int s_port; /* port service resides at */
    char *s_proto;  /* protocol to use */
};

The following details each member:

ss_nnaammee
     The official name of the service.

ss_aalliiaasseess
     This  points to  a  zero-terminated list  of alternate  names for  the
     service.

ss_ppoorrtt
     The  port  number at  which  the service  resides.   Port numbers  are
     returned in network byte order.

ss_pprroottoo
     The name of the protocol to use when contacting the service.

To close /eettcc/sseerrvviicceess, call function eennddsseerrvveenntt().

ggeettsseerrvveenntt() returns NULL  if an error occurs, or if  it encounters the end
of the file.

_S_e_e _A_l_s_o
eennddsseerrvveenntt(),   ggeettsseerrvvbbyynnaammee(),   ggeettsseerrvvbbyyppoorrtt(),   lliibbssoocckkeett,   nneettddbb.hh,
sseettsseerrvveenntt()

_N_o_t_e_s
This function uses a static data  space.  If your application needs to save
these data, it must copy them before any subsequent calls overwrite them.
