getrpcent_r

Section: C Library Functions (3)
Updated: 2025-06-28
Index JM Home Page roff page
 

名前

getrpcent_r, getrpcbyname_r, getrpcbynumber_r - RPC エントリーを 取得する (リエントラント版)  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#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
 

説明

関数 getrpcent_r(), getrpcbyname_r(), getrpcbynumber_r() は、 それぞれ getrpcent(3), getrpcbyname(3), getrpcbynumber(3) の リエントラント版である。 rpcent 構造体の返し方と、関数呼び出し時の引数と返り値が異なる。 このマニュアルページでは、リエントラントでない関数との違いだけを 説明する。

これらの関数は、関数の結果として静的に割り当てられた 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 が設定される。  

返り値

成功すると、これらの関数は 0 を返す。エラーの場合、「エラー」の節の リストにある正のエラー番号のいずれかを返す。

On error, record not found (getrpcbyname_r(), getrpcbynumber_r()), or end of input (getrpcent_r()) *result is set to NULL.  

エラー

ENOENT
(getrpcent_r()) データベースにこれ以上レコードがない。
ERANGE
buf is too small. Try again with a larger buffer (and increased size).
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
getrpcent_r(), getrpcbyname_r(), getrpcbynumber_r() Thread safetyMT-Safe locale
 

バージョン

Functions with similar names exist on some other systems, though typically with different calling signatures.  

標準規格

GNU.  

関連項目

getrpcent(3), rpc(5)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
バージョン
標準規格
関連項目

This document was created by man2html, using the manual pages.