.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
.\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
+.\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
.\"
.\" Japanese Version Copyright (c) 2004 Yuichi SATO
.\" all rights reserved.
.\" Translated Thu Jul 29 02:26:07 JST 2004
.\" by Yuichi SATO <ysato444@yahoo.co.jp>
.\"
-.TH GETGRENT_R 3 2007-07-26 "GNU" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH ̾Á°
-.\"O getgrent_r, fgetgrent_r \- get group file entry reentrantly
-getgrent_r, fgetgrent_r \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤ò¥ê¥¨¥ó¥È¥é¥ó¥È (reentrant) ¤Ë¼è¤ê½Ð¤¹
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.TH GETGRENT_R 3 2015\-01\-22 GNU "Linux Programmer's Manual"
+.SH 名前
+getgrent_r, fgetgrent_r \- グループファイルエントリーをリエントラント (reentrant) に取り出す
+.SH 書式
.nf
-.B #include <grp.h>
+\fB#include <grp.h>\fP
.sp
-.BI "int getgrent_r(struct group *" gbuf ", char *" buf ,
+\fBint getgrent_r(struct group *\fP\fIgbuf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
.br
-.BI " size_t " buflen ", struct group **" gbufp );
+\fB size_t \fP\fIbuflen\fP\fB, struct group **\fP\fIgbufp\fP\fB);\fP
.sp
-.BI "int fgetgrent_r(FILE *" fp ", struct group *" gbuf ", char *" buf ,
+\fBint fgetgrent_r(FILE *\fP\fIstream\fP\fB, struct group *\fP\fIgbuf\fP\fB, char *\fP\fIbuf\fP\fB,\fP
.br
-.BI " size_t " buflen ", struct group **" gbufp );
+\fB size_t \fP\fIbuflen\fP\fB, struct group **\fP\fIgbufp\fP\fB);\fP
.fi
.sp
.in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照):
.in
.sp
-.BR getgrent_r ():
-_GNU_SOURCE
.\" FIXME . The FTM requirements seem inconsistent here. File a glibc bug?
+\fBgetgrent_r\fP(): _GNU_SOURCE
.br
-.BR fgetgrent_r ():
-_SVID_SOURCE
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O The functions
-.\"O .BR getgrent_r ()
-.\"O and
-.\"O .BR fgetgrent_r ()
-.\"O are the reentrant versions of
-.\"O .BR getgrent (3)
-.\"O and
-.\"O .BR fgetgrent (3).
-´Ø¿ô
-.BR getgrent_r ()
-¤È
-.BR fgetgrent_r ()
-¤Ï
-.BR getgrent (3)
-¤È
-.BR fgetgrent (3)
-¤Î¥ê¥¨¥ó¥È¥é¥ó¥ÈÈǤǤ¢¤ë¡£
-.\"O The former reads the next group entry from the stream initialized by
-.\"O .BR setgrent (3).
-Á°¼Ô¤Ï¡¢
-.BR setgrent (3)
-¤Ë¤è¤Ã¤Æ½é´ü²½¤µ¤ì¤¿¥¹¥È¥ê¡¼¥à¤«¤é¡¢¼¡¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£
-.\"O The latter reads the next group entry from the stream
-.\"O .IR fp .
-¸å¼Ô¤Ï¡¢¥¹¥È¥ê¡¼¥à
-.I fp
-¤«¤é¼¡¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥È¥ê¤òÆɤ߹þ¤à¡£
+\fBfgetgrent_r\fP(): _SVID_SOURCE
+.SH 説明
+関数 \fBgetgrent_r\fP() と \fBfgetgrent_r\fP() は \fBgetgrent\fP(3) と \fBfgetgrent\fP(3)
+のリエントラント版である。 前者は、 \fBsetgrent\fP(3) によって初期化されたストリームから、次のグループファイルのエントリーを読み込む。
+後者は、 \fIstream\fP から次のグループファイルのエントリーを読み込む。
.PP
-.\"O The \fIgroup\fP structure is defined in
-.\"O .I <grp.h>
-.\"O as follows:
-\fIgroup\fP ¹½Â¤ÂΤÏ
-.I <grp.h>
-¤Ë¤ª¤¤¤Æ°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
+\fIgroup\fP 構造体は \fI<grp.h>\fP で以下のように定義されている:
.sp
.in +4n
.nf
struct group {
-.\"O char *gr_name; /* group name */
-.\"O char *gr_passwd; /* group password */
-.\"O gid_t gr_gid; /* group ID */
-.\"O char **gr_mem; /* group members */
- char *gr_name; /* ¥°¥ë¡¼¥×̾ */
- char *gr_passwd; /* ¥°¥ë¡¼¥×¥Ñ¥¹¥ï¡¼¥É */
- gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */
- char **gr_mem; /* ¥°¥ë¡¼¥×¥á¥ó¥Ð */
+ char *gr_name; /* グループ名 */
+ char *gr_passwd; /* グループのパスワード */
+ gid_t gr_gid; /* グループ ID */
+ char **gr_mem; /* グループのメンバ名へのポインター
+ の配列 (配列はヌルで終端する) */
};
.fi
.in
-.sp
-.\"O The nonreentrant functions return a pointer to static storage,
-.\"O where this static storage contains further pointers to group
-.\"O name, password and members.
-¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ê¤¤´Ø¿ô¤ÏÀÅŪ¤Ê³ÊǼÎΰè¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
-¤³¤ÎÀÅŪ¤Ê³ÊǼÎΰè¤Ë¤Ï¡¢¹¹¤Ë¥°¥ë¡¼¥×̾¡¦¥Ñ¥¹¥ï¡¼¥É¡¦
-¥á¥ó¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¡£
-.\"O The reentrant functions described here return all of that in
-.\"O caller-provided buffers.
-.\"O First of all there is the buffer
-.\"O .I gbuf
-.\"O that can hold a \fIstruct group\fP.
-.\"O And next the buffer
-.\"O .I buf
-.\"O of size
-.\"O .I buflen
-.\"O that can hold additional strings.
-¤³¤³¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë¥ê¥¨¥ó¥È¥é¥ó¥È¤Ê´Ø¿ô¤Ï¡¢
-¸Æ¤Ó½Ð¤·Â¦¤«¤éÄ󶡤µ¤ì¤ë¥Ð¥Ã¥Õ¥¡¤Ë¥°¥ë¡¼¥×̾¤Ê¤ÉÁ´¤Æ¤òÊÖ¤¹¡£
-ºÇ½é¤Î°ú¤¿ô¤È¤·¤Æ \fIstruct group\fP ¤òÊÝ»ý¤Ç¤¤ë¥Ð¥Ã¥Õ¥¡
-.I gbuf
-¤¬¤¢¤ë¡£
-¼¡¤Ë¤½¤Î¾¤Îʸ»úÎó¤òÊÝ»ý¤Ç¤¤ë¥µ¥¤¥º
-.I buflen
-¤Î¥Ð¥Ã¥Õ¥¡
-.I buf
-¤¬¤¢¤ë¡£
-.\"O The result of these functions, the \fIstruct group\fP read from the stream,
-.\"O is stored in the provided buffer
-.\"O .IR *gbuf ,
-.\"O and a pointer to this \fIstruct group\fP is returned in
-.\"O .IR *gbufp .
-¤³¤ì¤é¤Î´Ø¿ô¤Î·ë²Ì (¥¹¥È¥ê¡¼¥à¤«¤éÆɤ߹þ¤Þ¤ì¤¿ \fIstruct group\fP) ¤Ï¡¢
-Ä󶡤µ¤ì¤¿¥Ð¥Ã¥Õ¥¡
-.IR *gbuf
-¤Ë³ÊǼ¤µ¤ì¡¢¤³¤Î \fIstruct group\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï
-.IR *gbufp
-¤ËÊÖ¤µ¤ì¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success, these functions return 0 and
-.\"O .RI * gbufp
-.\"O is a pointer to the \fIstruct group\fP.
-À®¸ù¤·¤¿¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï 0 ¤òÊÖ¤·¡¢
-.RI * gbufp
-¤Ï \fIstruct group\fP ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ë¡£
-.\"O On error, these functions return an error value and
-.\"O .RI * gbufp
-.\"O is NULL.
-¥¨¥é¡¼¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¨¥é¡¼ÃͤòÊÖ¤·¡¢
-.RI * gbufp
-¤Ï NULL ¤Ë¤Ê¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.TP
-.B ENOENT
-.\"O No more entries.
-¼¡¤Î¥¨¥ó¥È¥ê¤¬¤Ê¤¤¡£
-.TP
-.B ERANGE
-.\"O Insufficient buffer space supplied.
-.\"O Try again with larger buffer.
-½½Ê¬¤Ê¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¡£
-¤â¤Ã¤ÈÂ礤ʥХåե¡¤ÇºÆÅټ¹Ԥ¹¤ë¤³¤È¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O These functions are GNU extensions, done in a style resembling
-.\"O the POSIX version of functions like
-.\"O .BR getpwnam_r (3).
-¤³¤ì¤é¤Î´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢POSIX ÈǤδؿô
-.BR getpwnam_r (3)
-¤Î·Á¼°¤Ë»÷¤»¤Æ¤¢¤ë¡£
-.\"O Other systems use prototype
-¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï°Ê²¼¤Î¥×¥í¥È¥¿¥¤¥×¤¬»È¤ï¤ì¤Æ¤¤¤ë¡£
+.PP
+この構造体のフィールドの詳細は \fBgroup\fP(5) を参照のこと。
+.PP
+リエントラントでない関数は静的な格納領域へのポインターを返す。 この静的な格納領域には、更にグループ名・パスワード・ メンバへのポインターが含まれる。
+ここで説明されているリエントラントな関数は、 呼び出し側から提供されるバッファーにグループ名など全てを返す。 最初の引き数として \fIstruct
+group\fP を保持できるバッファー \fIgbuf\fP がある。 次にその他の文字列を保持できるサイズ \fIbuflen\fP のバッファー \fIbuf\fP
+がある。 これらの関数の結果 (ストリームから読み込まれた \fIstruct group\fP) は、 提供されたバッファー \fI*gbuf\fP
+に格納され、この \fIstruct group\fP へのポインターは \fI*gbufp\fP に返される。
+.SH 返り値
+成功した場合、これらの関数は 0 を返し、 *\fIgbufp\fP は \fIstruct group\fP へのポインターとなる。
+エラーの場合、これらの関数はエラー値を返し、 *\fIgbufp\fP は NULL になる。
+.SH エラー
+.TP
+\fBENOENT\fP
+次のエントリーがない。
+.TP
+\fBERANGE\fP
+十分なバッファー空間が与えられていない。 もっと大きなバッファーで再度実行すること。
+.SH 準拠
+これらの関数は GNU 拡張であり、POSIX 版の関数 \fBgetpwnam_r\fP(3) の形式に似せてある。
+他のシステムでは以下のプロトタイプが使われている。
.sp
.nf
.in +4n
.in
.fi
.sp
-.\"O or, better,
-¤è¤êÎɤ¤¤â¤Î¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
+より良いものでは、以下のようになっている。
.sp
.nf
.in +4n
FILE **gr_fp);
.in
.fi
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O The function
-.\"O .BR getgrent_r ()
-.\"O is not really reentrant since it shares the reading position
-.\"O in the stream with all other threads.
-´Ø¿ô
-.BR getgrent_r ()
-¤ÏËÜÅö¤Î¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£
-¤Ê¤¼¤Ê¤é¡¢¥¹¥È¥ê¡¼¥à¤ÎÆɤ߹þ¤ß°ÌÃÖ¤ò
-¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤È¶¦Í¤·¤Æ¤¤¤ë¤¿¤á¤Ç¤¢¤ë¡£
-.\"O .SH EXAMPLE
-.SH Îã
+.SH 注意
+関数 \fBgetgrent_r\fP() は本当のリエントラントではない。 なぜなら、ストリームの読み込み位置を
+他の全てのスレッドと共有しているためである。
+.SH 例
.nf
#define _GNU_SOURCE
#include <grp.h>
exit(EXIT_SUCCESS);
}
.fi
-.\"O .\" perhaps add error checking - should use strerror_r
-.\" ¤¿¤Ö¤ó¥¨¥é¡¼¥Á¥§¥Ã¥¯¤òÄɲ䷤ơ¢strerror_r ¤ò»È¤¦¤Ù¤¤À¤í¤¦¡£
+.\" perhaps add error checking - should use strerror_r
.\" #include <errno.h>
.\" #include <stdlib.h>
.\" if (i) {
.\" printf("getgrent_r: %s", strerror(i));
.\" exit(EXIT_FAILURE);
.\" }
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR fgetgrent (3),
-.BR getgrent (3),
-.BR getgrgid (3),
-.BR getgrnam (3),
-.BR putgrent (3),
-.BR group (5)
+.SH 関連項目
+\fBfgetgrent\fP(3), \fBgetgrent\fP(3), \fBgetgrgid\fP(3), \fBgetgrnam\fP(3),
+\fBputgrent\fP(3), \fBgroup\fP(5)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。