getservbyname returns a servent structure for the line from /etc/services that matches the service name using protocol proto.
The servent structure is defined in netdb.h as follows:
struct servent { char *s_name; /* official service name */ char **s_aliases; /* alias list */ int s_port; /* port number */ char *s_proto; /* protocol to use */ } |