OSDN Git Service

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