Gets information on the named service from the network services database.
#include <netdb.h> struct servent *getservbyname (char *name, char *proto);
This routine returns a pointer to a servent structure containing the broken-out fields of the requested line in the network services database.
See the <netdb.h> header file for a description of the servent structure.
All information is contained in a static area, so it must be copied if it is to be saved.
See also getservbyport in this section.
NULL | Indicates EOF or an error. |
x | A pointer to a servent structure. |