Man page - getprotoent(3)

Packages contains this manual

Available languages:

en fr es pl cs ja ru ro

Manual

GETPROTOENT

名 前
書 式
説 明
返 り 値
フ ァ イ ル
属 性
準 拠
関 連 項 目
こ の 文 書 に つ い て

名 前

getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent - プ ロ ト コ ル の エ ン ト リ ー を 取 得 す る

書 式

#include <netdb.h>

struct protoent *getprotoent(void);

struct protoent *getprotobyname(const char * name );

struct protoent *getprotobynumber(int proto );

void setprotoent(int stayopen );

void endprotoent(void);

説 明

getprotoent () 関 数 は 、 プ ロ ト コ ル の デ ー タ ベ ー ス ( protocols (5) 参 照 ) か ら 次 の エ ン ト リ ー を 読 み 込 み 、 そ の エ ン ト リ ー を protoent 構 造 体 の 要 素 別 の フ ィ ー ル ド に 格 納 し 、 そ の 構 造 体 を 返 す 。 必 要 で あ れ ば 、 デ ー タ ベ ー ス へ の 接 続 が オ ー プ ン さ れ る 。

getprotobyname () 関 数 は 、 プ ロ ト コ ル 名 name に マ ッ チ す る エ ン ト リ ー を デ ー タ ベ ー ス か ら 探 し 、 そ の エ ン ト リ ー を 収 め た protoent 構 造 体 を 返 す 。 必 要 で あ れ ば 、 デ ー タ ベ ー ス へ の 接 続 が オ ー プ ン さ れ る 。

getprotobynumber () 関 数 は 、 プ ロ ト コ ル 番 号 number に マ ッ チ す る エ ン ト リ ー を デ ー タ ベ ー ス か ら 探 し 、 そ の エ ン ト リ ー を 収 め た protoent 構 造 体 を 返 す 。 必 要 で あ れ ば 、 デ ー タ ベ ー ス へ の 接 続 が オ ー プ ン さ れ る 。

setprotoent () 関 数 は デ ー タ ベ ー ス へ の 接 続 を オ ー プ ン し 、 次 の 読 み 込 み エ ン ト リ ー を 先 頭 の エ ン ト リ ー に 設 定 す る 。 stayopen が 0 で な い 場 合 、 一 つ 一 つ の getproto* () 関 数 の 呼 び 出 し 間 で デ ー タ ベ ー ス へ の 接 続 を ク ロ ー ズ し な い 。

endprotoent () 関 数 は デ ー タ ベ ー ス へ の 接 続 を ク ロ ー ズ す る 。

protoent 構 造 体 は <netdb.h> で 以 下 の よ う に 定 義 さ れ て い る 。

struct protoent {
char *p_name; /* official protocol name */
char **p_aliases; /* alias list */
int p_proto; /* protocol number */
}

protoent 構 造 体 の メ ン バ ー は 以 下 の 通 り 。

p_name

プ ロ ト コ ル の 正 式 名 (official name)。

p_aliases

プ ロ ト コ ル の 別 名 の リ ス ト 。 リ ス ト は ヌ ル で 終 端 さ れ る 。

p_proto

プ ロ ト コ ル の 番 号

返 り 値

getprotoent (), getprotobyname (), getprotobynumber () 関 数 は 、 静 的 に 割 り 当 て ら れ た protoent 構 造 体 へ の ポ イ ン タ ー を 返 す 。 エ ラ ー が 起 こ っ た り 、 フ ァ イ ル の 最 後 に 達 し た 場 合 は NULL を 返 す 。

フ ァ イ ル

/etc/protocols

プ ロ ト コ ル の デ ー タ ベ ー ス フ ァ イ ル

属 性

こ の 節 で 使 用 さ れ て い る 用 語 の 説 明 は attributes (7) を 参 照 の こ と 。

Image grohtml-41673-1.png

In the above table, protoent in race:protoent signifies that if any of the functions setprotoent (), getprotoent (), or endprotoent () are used in parallel in different threads of a program, then data races could occur.

準 拠

POSIX.1-2001, POSIX.1-2008, 4.3BSD.

関 連 項 目

getnetent (3), getprotoent_r (3), getservent (3), protocols (5)

こ の 文 書 に つ い て

こ の man ペ ー ジ は Linux man-pages プ ロ ジ ェ ク ト の リ リ ー ス 5.10 の 一 部 で あ る 。 プ ロ ジ ェ ク ト の 説 明 と バ グ 報 告 に 関 す る 情 報 は https://www.kernel.org/doc/man-pages/ に 書 か れ て い る 。