This function searches the services database until a matching service name is found or the end of file is encountered. If a protocol name is also supplied, searches must also match the protocol. This function returns a pointer to a servent structure containing the data from the network services database. For information about the servent structure, refer to servent Structure. All information is contained in a static area, so it must be copied to be saved. Related Functions See also getservbyport().