Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getprotobyname_r(3) OSS Library Calls Reference Manual
NAME
getprotobyname_r - Gets a protocol entry by name (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that do not use the Standard POSIX Thread library: |
/G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes that do not use the Standard POSIX Thread library: |
/G/system/zdllnnn/yinetdll |
H-series and J-series OSS processes that use the Standard POSIX Thread library:
/G/system/zdllnnn/zsptdll
(See NOTES)
SYNOPSIS
[#include <sys/socket.h>]
#include <netdb.h>
[#include <spthread.h>] /* Required if using Standard POSIX Threads Library */
struct protoent *getprotobyname_r (
const char *name,
struct protoent *ret,
char *buffer,
int buflen);
PARAMETERS
name Specifies the protocol name or alias.
ret Points to a protoent structure allocated by the caller.
buffer Points to the buffer supplied by the caller and used as a storage space for
returned data.
buflen Specifies the size of the buffer passed in bytes. For H06.21 and later H-series
RVUs and J06.10 and later J-series RVUs, HP recommends that this buffer be at
least equal to the size of the protoent_data structure.
DESCRIPTION
The getprotobyname_r( ) function is the reentrant version of the getprotobyname( ) function
and performs the same function. However, the getprotobyname_r( ) function uses buffers that
are supplied by the caller of the function to store returned results.
The ret parameter must be a pointer to a struct protoent structure allocated by the caller. On
successful completion, the function returns the protocol entry in this structure. The buffer param-
eter must be a pointer to a buffer supplied by the caller. This buffer is used as storage space for
the host data. All of the pointers within the returned struct protoent ret point to data stored
within this buffer. The buffer must be large enough to hold all of the data associated with the host
entry. For H06.21 and later H-series RVUs and J06.10 and later J-series RVUs, HP recommends
that the size of the buffer, indicated by the buflen parameter, be equal or greater than the size of
the protoent_data structure.
If multiple threads interleave calls to getprotobyname_r( ), getprotobynumber_r( ),
getprotoent_r( ) and their base versions, the threads enumerate disjoint subsets of the protocol
database.
3106 Hewlett-Packard Company 527187-017