OSDN Git Service

LDP: Update draft based on the previous commit
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man3 / getnetent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sat Jul 24 21:48:06 1993 by Rik Faith (faith@cs.unc.edu)
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
37 .\" Translated 1998-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
38 .\" Modified 1998-06-22, NAKANO Takeo
39 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\"
41 .TH GETNETENT 3 2020\-12\-21 GNU "Linux Programmer's Manual"
42 .SH 名前
43 getnetent, getnetbyname, getnetbyaddr, setnetent, endnetent \-
44 ネットワークエントリーを取得する
45 .SH 書式
46 .nf
47 \fB#include <netdb.h>\fP
48 .PP
49 \fBstruct netent *getnetent(void);\fP
50 .PP
51 \fBstruct netent *getnetbyname(const char *\fP\fIname\fP\fB);\fP
52 .PP
53 \fBstruct netent *getnetbyaddr(uint32_t \fP\fInet\fP\fB, int \fP\fItype\fP\fB);\fP
54 .PP
55 \fBvoid setnetent(int \fP\fIstayopen\fP\fB);\fP
56 .PP
57 \fBvoid endnetent(void);\fP
58 .fi
59 .SH 説明
60 \fBgetnetent\fP()  関数はネットワークデータベースから次のエントリーを読み込み、 そのエントリーを \fInetent\fP
61 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。
62 .PP
63 \fBgetnetbyname\fP()  関数は、ネットワーク名 \fIname\fP にマッチするエントリーを データベースから探し、そのエントリーを収めた
64 \fInetent\fP 構造体を返す。
65 .PP
66 \fBgetnetbyaddr\fP()  関数は、\fItype\fP 型のネットワーク番号 \fInet\fP にマッチするエントリーを
67 データベースから探し、そのエントリーを収めた \fInetent\fP 構造体を返す。 \fInet\fP 引き数はホストバイトオーダでなければならない。
68 .PP
69 \fBsetnetent\fP()  関数はデータベースへの接続をオープンし、 次の読み込みエントリーを先頭のエントリーに設定する。 \fIstayopen\fP
70 が 0 でない場合、 一つ一つの \fBgetnet*\fP()  関数の呼び出し間でデータベースへの接続をクローズしない。
71 .PP
72 \fBendnetent\fP()  関数はデータベースへの接続をクローズする。
73 .PP
74 \fInetent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
75 .PP
76 .in +4n
77 .EX
78 struct netent {
79     char      *n_name;     /* official network name */
80     char     **n_aliases;  /* alias list */
81     int        n_addrtype; /* net address type */
82     uint32_t   n_net;      /* network number */
83 }
84 .EE
85 .in
86 .PP
87 \fInetent\fP 構造体のメンバは以下の通り。
88 .TP 
89 \fIn_name\fP
90 ネットワークの正式名 (official name)。
91 .TP 
92 \fIn_aliases\fP
93 ネットワークの別名からなるリスト。 リストはヌルで終端される。
94 .TP 
95 \fIn_addrtype\fP
96 ネットワーク番号の形式。現在は \fBAF_INET\fP のみ。
97 .TP 
98 \fIn_net\fP
99 ホストバイトオーダ形式のネットワーク番号。
100 .SH 返り値
101 The \fBgetnetent\fP(), \fBgetnetbyname\fP(), and \fBgetnetbyaddr\fP()  functions
102 return a pointer to a statically allocated \fInetent\fP structure, or a null
103 pointer if an error occurs or the end of the file is reached.
104 .SH ファイル
105 .TP 
106 \fI/etc/networks\fP
107 ネットワークデータベースファイル
108 .SH 属性
109 この節で使用されている用語の説明は \fBattributes\fP(7) を参照のこと。
110 .TS
111 allbox;
112 lbw14 lb lbw25
113 l l l.
114 Interface       Attribute       Value
115 T{
116 \fBgetnetent\fP()
117 T}      Thread safety   T{
118 MT\-Unsafe race:netent
119 .br
120 race:netentbuf env locale
121 T}
122 T{
123 \fBgetnetbyname\fP()
124 T}      Thread safety   T{
125 MT\-Unsafe race:netbyname
126 .br
127 env locale
128 T}
129 T{
130 \fBgetnetbyaddr\fP()
131 T}      Thread safety   T{
132 MT\-Unsafe race:netbyaddr
133 .br
134 locale
135 T}
136 T{
137 \fBsetnetent\fP(),
138 .br
139 \fBendnetent\fP()
140 T}      Thread safety   T{
141 MT\-Unsafe race:netent env
142 .br
143 locale
144 T}
145 .TE
146 .sp 1
147 In the above table, \fInetent\fP in \fIrace:netent\fP signifies that if any of the
148 functions \fBsetnetent\fP(), \fBgetnetent\fP(), or \fBendnetent\fP()  are used in
149 parallel in different threads of a program, then data races could occur.
150 .SH 準拠
151 POSIX.1\-2001, POSIX.1\-2008, 4.3BSD.
152 .SH 注意
153 バージョン 2.2 より前の glibc では、 \fBgetnetbyaddr\fP()  の引き数 \fInet\fP は \fIlong\fP 型だった。
154 .SH 関連項目
155 .\" .BR networks (5)
156 \fBgetnetent_r\fP(3), \fBgetprotoent\fP(3), \fBgetservent\fP(3)
157 .br
158 RFC\ 1101
159 .SH この文書について
160 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
161 \%https://www.kernel.org/doc/man\-pages/ に書かれている。