OSDN Git Service

dafe538d1ec7a39e39dcc457010acbf0a4b575a1
[linuxjm/LDP_man-pages.git] / release / man3 / setnetgrent.3
1 .\"  Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .\"  based on glibc infopages
8 .\" polished - aeb
9 .\"
10 .\"*******************************************************************
11 .\"
12 .\" This file was generated with po4a. Translate the source file.
13 .\"
14 .\"*******************************************************************
15 .\"
16 .\" Japanese Version Copyright (c) 2005  Akihiro MOTOKI
17 .\"         all rights reserved.
18 .\" Translated 2005-02-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
19 .\"
20 .TH SETNETGRENT 3 2007\-07\-26 GNU "Linux Programmer's Manual"
21 .SH 名前
22 setnetgrent, endnetgrent, getnetgrent, getnetgrent_r, innetgr \-
23 ネットワーク・グループのエントリを操作する
24 .SH 書式
25 .nf
26 \fB#include <netdb.h>\fP
27
28 \fBint setnetgrent(const char *\fP\fInetgroup\fP\fB);\fP
29
30 \fBvoid endnetgrent(void);\fP
31
32 \fBint getnetgrent(char **\fP\fIhost\fP\fB, char **\fP\fIuser\fP\fB, char **\fP\fIdomain\fP\fB);\fP
33
34 \fBint getnetgrent_r(char **\fP\fIhost\fP\fB, char **\fP\fIuser\fP\fB,\fP
35 \fB                  char **\fP\fIdomain\fP\fB, char *\fP\fIbuf\fP\fB, int \fP\fIbuflen\fP\fB);\fP
36
37 \fBint innetgr(const char *\fP\fInetgroup\fP\fB, const char *\fP\fIhost\fP\fB,\fP
38 \fB            const char *\fP\fIuser\fP\fB, const char *\fP\fIdomain\fP\fB);\fP
39 .fi
40 .sp
41 .in -4n
42 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
43 .in
44 .sp
45 .ad l
46 \fBsetnetgrent\fP(), \fBendnetgrent\fP(), \fBgetnetgrent\fP(), \fBgetnetgrent_r\fP(),
47 \fBinnetgr\fP(): _BSD_SOURCE || _SVID_SOURCE
48 .ad b
49 .SH 説明
50 \fInetgroup\fP は SunOS で考案されたものである。ネットグループのデータベースの エントリは、 3 つの文字列のリスト
51 (\fIhostname\fP, \fIusername\fP, \fIdomainname\fP)  もしくはネットグループ名である。
52 前記のリストの各要素は空であってもよい。 空は何とでも一致することを意味する。 本ページで説明する関数を使うことで、ネットグループのデータベースに
53 アクセスすることができる。どのデータベースが検索されるかは \fI/etc/nsswitch.conf\fP ファイルで定義されている。
54 .PP
55 \fBsetnetgrent\fP()  コールは、この後で呼ばれる \fBgetnetgrent\fP()  コールが検索するネットグループを定める。
56 \fBgetnetgrent\fP()  関数はネットグループの次のエントリを取得し、 \fIhost\fP, \fIuser\fP, \fIdomain\fP
57 にポインタを入れて返る。ヌルポインタは、対応するエントリがどんな文字列とも一致することを意味する。
58 得られたポインタは、ネットグループ関係の関数のいずれかが呼ばれるまでの 間だけ有効である。この問題を避けるためには GNU 拡張の関数
59 \fBgetnetgrent_r\fP()  を使うとよい。この関数は呼び出し側が用意したバッファに 文字列を格納する。割り当て済のバッファを全て解放するには
60 \fBendnetgrent\fP()  を使用する。
61 .PP
62 ほとんどの場合、 (\fIhostname\fP, \fIusername\fP, \fIdomainname\fP)
63 の3要素の組がネットグループのメンバーかどうかを確認したいだけであろう。 \fBinnetgr\fP()
64 関数を使うと、上記の3つの関数を呼び出さずにこの目的を達成できる。 もう一度書いておくが、NULL ポインタはワイルドカードであり、
65 あらゆる文字列と一致する。この関数はスレッドセーフである。
66 .SH 返り値
67 これらの関数は成功すると 1 を、失敗すると 0 を返す。
68 .SH ファイル
69 \fI/etc/netgroup\fP
70 .br
71 \fI/etc/nsswitch.conf\fP
72 .SH 準拠
73 .\" getnetgrent_r() is on Solaris 8 and AIX 5.1, but not the BSDs.
74 これらの関数は POSIX.1\-2001 にはないが、 setnetgrent (), endnetgrent (), getnetgrent (),
75 innetgr ()  はほとんどの UNIX システムで利用可能である。 \fBgetnetgrent_r\fP()
76 は広く他のシステムで利用できるわけではない。
77 .SH 注意
78 BSD の実装では \fBsetnetgrent\fP()  は void を返す。
79 .SH 関連項目
80 \fBsethostent\fP(3), \fBsetprotoent\fP(3), \fBsetservent\fP(3)
81 .SH この文書について
82 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部
83 である。プロジェクトの説明とバグ報告に関する情報は
84 http://www.kernel.org/doc/man\-pages/ に書かれている。