Gets information on the specified port from the network services database.
#include <netdb.h> struct servent *getservbyport (int port, 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 getservbyname in this section.
NULL | Indicates EOF or an error. |
x | A pointer to a servent structure. |