OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / getprotoent_r.3
index c419525..259623b 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
 .\"    <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -20,6 +21,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\"*******************************************************************
 .\"
@@ -28,8 +30,8 @@
 .\"*******************************************************************
 .TH GETPROTOENT_R 3 2010\-09\-10 GNU "Linux Programmer's Manual"
 .SH 名前
-getprotoent_r, getprotobyname_r, getprotobynumber_r \- get protocol entry
-(reentrant)
+getprotoent_r, getprotobyname_r, getprotobynumber_r \- プロトコル
+エントリを取得する (リエントラント版)
 .SH 書式
 .nf
 \fB#include <netdb.h>\fP
@@ -57,53 +59,58 @@ _BSD_SOURCE || _SVID_SOURCE
 .RE
 .ad b
 .SH 説明
-The \fBgetprotoent_r\fP(), \fBgetprotobyname_r\fP(), and \fBgetprotobynumber_r\fP()
-functions are the reentrant equivalents of, respectively, \fBgetprotoent\fP(3),
-\fBgetprotobyname\fP(3), and \fBgetprotobynumber\fP(3).  They differ in the way
-that the \fIprotoent\fP structure is returned, and in the function calling
-signature and return value.  This manual page describes just the differences
-from the nonreentrant functions.
+関数 \fBgetprotoent_r\fP(), \fBgetprotobyname_r\fP(),
+\fBgetprotobynumber_r\fP() は、それぞれ \fBgetprotoent\fP(3),
+\fBgetprotobyname\fP(3), \fBgetprotobynumber\fP(3) のリエントラント版である。
+\fIprotoent\fP 構造体の返し方と、関数呼び出し時の引き数と返り値が異なる。
+このマニュアルページでは、リエントラントでない関数との違いだけを
+説明する。
 
-Instead of returning a pointer to a statically allocated \fIprotoent\fP
-structure as the function result, these functions copy the structure into
-the location pointed to by \fIresult_buf\fP.
+これらの関数は、関数の結果として静的に割り当てられた \fIprotoent\fP 構造体
+へのポインタを返すのではなく、 \fIprotoent\fP 構造体を \fIresult_buf\fP が
+指す場所にコピーする。
 
 .\" I can find no information on the required/recommended buffer size;
 .\" the nonreentrant functions use a 1024 byte buffer.
 .\" The 1024 byte value is also what the Solaris man page suggests. -- mtk
-The \fIbuf\fP array is used to store the string fields pointed to by the
-returned \fIprotoent\fP structure.  (The nonreentrant functions allocate these
-strings in static storage.)  The size of this array is specified in
-\fIbuflen\fP.  If \fIbuf\fP is too small, the call fails with the error \fBERANGE\fP,
-and the caller must try again with a larger buffer.  (A buffer of length
-1024 bytes should be sufficient for most applications.)
-
-If the function call successfully obtains a protocol record, then \fI*result\fP
-is set pointing to \fIresult_buf\fP; otherwise, \fI*result\fP is set to NULL.
+配列 \fIbuf\fP は、返される \fIprotoent\fP 構造体が指す文字列フィールドを
+格納するのに使用される (リエントラントでない関数の場合は、
+これらの文字列は静的な領域に格納される)。
+この配列の大きさは \fIbuflen\fP で指定される。
+\fIbuf\fP が小さすぎる場合、関数呼び出しはエラー \fBERANGE\fP で失敗し、
+呼び出し側ではもっと大きなバッファで再度呼び出す必要がある (ほとんどの
+アプリケーションでは、長さ 1024 バイトのバッファで十分なはずである)。
+
+関数呼び出しでプロトコルレコードの取得に成功すると、
+\fI*result\fP は \fIresult_buf\fP を指すように設定される。
+それ以外の場合は \fI*result\fP に NULL が設定される。
 .SH 返り値
-On success, these functions return 0.  On error, they return one of the
-positive error numbers listed in ERRORS.
+成功すると、これらの関数は 0 を返す。エラーの場合、「エラー」の節の
+リストにある正のエラー番号のいずれかを返す。
 
-On error, record not found (\fBgetprotobyname_r\fP(), \fBgetprotobynumber_r\fP()),
-or end of input (\fBgetprotoent_r\fP())  \fIresult\fP is set to NULL.
+エラーの場合、レコードが見つからなかった場合 (\fBgetprotobyname_r\fP(),
+\fBgetprotobyaddr_r\fP()) やこれ以上レコードがない場合
+(\fBgetprotoent_r\fP())、\fIresult\fP には NULL が設定される。
 .SH エラー
 .TP 
 \fBENOENT\fP
-(\fBgetprotoent_r\fP())  No more records in database.
+(\fBgetprotoent_r\fP())  データベースにこれ以上レコードがない。
 .TP 
 \fBERANGE\fP
-\fIbuf\fP is too small.  Try again with a larger buffer (and increased
-\fIbuflen\fP).
+\fIbuf\fP が小さすぎる。もっと大きなバッファにして
+(または \fIbuflen\fP を増やして) 再度呼び出すこと。
 .SH 準拠
-These functions are GNU extensions.  Functions with similar names exist on
-some other systems, though typically with different calling signatures.
+これらの関数は GNU による拡張である。
+他のシステムにも同様の名前の関数が存在する場合があるが、
+通常は関数の引き数が異なる。
 .SH 例
-The program below uses \fBgetprotobyname_r\fP()  to retrieve the protocol
-record for the protocol named in its first command\-line argument.  If a
-second (integer) command\-line argument is supplied, it is used as the
-initial value for \fIbuflen\fP; if \fBgetprotobyname_r\fP()  fails with the error
-\fBERANGE\fP, the program retries with larger buffer sizes.  The following
-shell session shows a couple of sample runs:
+以下のプログラムは、 \fBgetprotobyname_r\fP() を使って、最初のコマンド
+ライン引き数で指定された名前のプロトコルのレコードを取得する。
+二番目のコマンドライン引き数 (整数値) が指定された場合は、
+その値が \fIbuflen\fP の初期値として使用される。
+\fBgetprotobyname_r\fP() がエラー \fBERANGE\fP で失敗すると、プログラムは
+より大きなバッファサイズで再度 \fBgetprotobyname_r\fP を呼び出す。
+下記のシェルのセッションは、実行例を示している。
 .in +4n
 .nf
 
@@ -194,3 +201,7 @@ main(int argc, char *argv[])
 .fi
 .SH 関連項目
 \fBgetprotoent\fP(3), \fBprotocols\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。