#include <netdb.h>
int getrpcent_r(size_t size;
struct rpcent *result_buf, char buf[size],
size_t size, struct rpcent **result);
int getrpcbyname_r(size_t size;
const char *name,
struct rpcent *result_buf, char buf[size],
size_t size, struct rpcent **result);
int getrpcbynumber_r(size_t size;
int number,
struct rpcent *result_buf, char buf[size],
size_t size, struct rpcent **result);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
getrpcent_r(), getrpcbyname_r(), getrpcbynumber_r():
Since glibc 2.19:
_DEFAULT_SOURCE
glibc 2.19 and earlier:
_BSD_SOURCE || _SVID_SOURCE
これらの関数は、関数の結果として静的に割り当てられた rpcent 構造体 へのポインターを返すのではなく、 rpcent 構造体を result_buf が 指す場所にコピーする。
The buf array is used to store the string fields pointed to by the returned rpcent structure. (The nonreentrant functions allocate these strings in static storage.) The size of this array is specified in size. If buf is too small, the call fails with the error ERANGE, and the caller must try again with a larger buffer. (A buffer of size 1024 bytes should be sufficient for most applications.)
関数呼び出しで RPC レコードの取得に成功すると、 *result は result_buf を指すように設定される。 それ以外の場合は *result に NULL が設定される。
On error, record not found (getrpcbyname_r(), getrpcbynumber_r()), or end of input (getrpcent_r()) *result is set to NULL.
| インターフェース | 属性 | 値 |
| getrpcent_r(), getrpcbyname_r(), getrpcbynumber_r() | Thread safety | MT-Safe locale |