Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (g - h) getservbyport_r(3)
The structure of type servent is defined in the netdb.h header file as:
struct servent {
char *s_name;
char **s_aliases;
int s_port;
char s_proto;
};
The fields of this structure are:
s_name Points to the official name of the service.
s_aliases Points to a zero-terminated list of alternate names for the service.
s_port The port number at which the service resides. Port numbers are returned in net-
work byte order.
s_proto The name of the protocol to use when contacting the service.
ERRORS
If this condition occurs, the getservbyport_r( ) function sets errno to the corresponding value:
[ERANGE] Insufficient storage was supplied via buffer and buflen to contain the data to be
referenced by the resulting servent structure.
FILES
/etc/services The Internet network service name database file.
RELATED INFORMATION
Functions: getservbyname(3), getservbyname_r(3), getservbyport(3), getservent(3),
getservent_r(3), setservent(3), endservent(3).
Files: services(4) thread_safety(5).
STANDARDS CONFORMANCE
H06.21 and later H-series RVUs and J06.10 and later J-series RVUs
This function conforms to IEEE Std 1003.1 2004, POSIX System Application Program Interface.
Standard POSIX Threads Library version of this function
This function is an extension to the UNIX98 specification. Interfaces documented on this refer-
ence page conform to the following industry standards:
• IEEE Std 1003.1-c1995, POSIX System Application Program Interface
The use of the header file spthread.h is an HP exception to the POSIX standard.
527187-017 Hewlett-Packard Company 3−143