setprotoent
getprotoent
endprotoent
setprotoent
getprotoent EXPR
endprotoent
getprotoent EXPR
endprotoent
setprotoent
[概要] /etc/protocolsファイルをオープンします。
[戻り値] プロトコル名、エイリアス、プロトコル番号を返します。
getprotoent
[概要] 現在の位置の情報を取り出して返し、次の位置に移動します。
[戻り値] 成功時は"真"、失敗時は"偽"を返します。
endprotoent
[概要] /etc/protocolsクローズします。
[戻り値] 成功時は"真"、失敗時は"偽"を返します。
getprotoent/setprotoent/endprotoentの使い方
# /etc/protocolsファイルからすべてのエントリを出力
setprotoent(1);
while ( my ($protname, $alias, $protnum) = getprotoent ) {
...
}
endprotoent;