|
NAMEgetservent , getservbyport ,
getservbyname , setservent ,
endservent —
get service entry
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <netdb.h>
struct servent *
struct servent *
struct servent *
void
void
DESCRIPTIONThegetservent (),
getservbyname (), and
getservbyport () functions each return a pointer to an
object with the following structure containing the broken-out fields of a line
in the network services data base, /etc/services.
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 members of this structure are:
The The The The FILES
DIAGNOSTICSNull pointer returned onEOF or error.
SEE ALSOgetprotoent(3), services(5)HISTORYThegetservent (),
getservbyport (),
getservbyname (), setservent (),
and endservent () functions appeared in
4.2BSD.
BUGSThese functions use a thread-specific data storage; if the data is needed for future use, it should be copied before any subsequent calls overwrite it. Expecting port numbers to fit in a 32 bit quantity is probably naive.
Visit the GSP FreeBSD Man Page Interface. |