OSDN Git Service

cc1f58f3f2326f0fa1d26ed0a5fdd210b74990a7
[linuxjm/LDP_man-pages.git] / draft / man2 / query_module.2
1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
2 .\" This file is distributed according to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
4 .\"
5 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
6 .\" reformatting and rewordings by mtk
7 .\"
8 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
9 .\" Translated 2006-07-29, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
10 .\"
11 .TH QUERY_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual"
12 .\"O .SH NAME
13 .SH 名前
14 .\"O query_module \- query the kernel for various bits pertaining to modules
15 query_module \- モジュールに関連する各種の情報をカーネルに問い合わせる
16 .\"O .SH SYNOPSIS
17 .SH 書式
18 .nf
19 .B #include <linux/module.h>
20 .sp
21 .BI "int query_module(const char *" name ", int " which ", void *" buf ,
22 .BI "                 size_t " bufsize ", size_t *" ret );
23 .fi
24 .\"O .SH DESCRIPTION
25 .SH 説明
26 .\"O .BR query_module ()
27 .\"O requests information from the kernel about loadable modules.
28 .\"O The returned information is placed in the buffer pointed to by
29 .\"O .IR buf .
30 .\"O The caller must specify the size of
31 .\"O .I buf
32 .\"O in
33 .\"O .IR bufsize .
34 .\"O The precise nature and format of the returned information
35 .\"O depend on the operation specified by
36 .\"O .IR which .
37 .\"O Some operations require
38 .\"O .I name
39 .\"O to identify a currently loaded module, some allow
40 .\"O .I name
41 .\"O to be NULL, indicating the kernel proper.
42 .BR query_module ()
43 は、ローダブルモジュールに関する情報をカーネルに問い合わせる。
44 情報は
45 .I buf
46 が指し示すバッファに格納されて返される。
47 呼び出し元は
48 .I buf
49 のサイズを
50 .I bufsize
51 に指定しなければならない。
52 得られる情報の正確な意味とフォーマットは、
53 .I which
54 でどの操作を指定するかによって異なる。
55 現在ロードされているモジュールを特定するために
56 .I name
57 を必要とする操作があれば、
58 カーネル固有であることを示す NULL を指定できる操作もある。
59
60 .\"O The following values can be specified for
61 .\"O .IR which :
62 .I which
63 には以下の値を指定できる:
64 .TP
65 .B 0
66 .\"O Returns success, if the kernel supports
67 .\"O .BR query_module ().
68 .\"O Used to probe for availability of the system call.
69 カーネルが
70 .BR query_module ()
71 をサポートしている場合、成功を返す。
72 このシステムコールが利用可能かを調べるために使われる。
73 .TP
74 .B QM_MODULES
75 .\"O Returns the names of all loaded modules.
76 .\"O The returned buffer consists of a sequence of null-terminated strings;
77 .\"O .I ret
78 .\"O is set to the number of
79 .\"O modules.
80 ロードされている全てのモジュールの名前を返す。
81 バッファには、NULL 終端された文字列が順に入る。
82 返されるバッファ
83 .I ret
84 にはモジュールの数が設定される。
85 .\" ret is set on ENOSPC
86 .TP
87 .B QM_DEPS
88 .\"O Returns the names of all modules used by the indicated module.
89 .\"O The returned buffer consists of a sequence of null-terminated strings;
90 .\"O .I ret
91 .\"O is set to the number of modules.
92 指定されたモジュールが使用している全モジュールの名前を返す。
93 バッファには、NULL 終端された文字列が順に入る。
94 返されるバッファ
95 .I ret
96 にはモジュールの数が設定される。
97 .\" ret is set on ENOSPC
98 .TP
99 .B QM_REFS
100 .\"O Returns the names of all modules using the indicated module.
101 .\"O This is the inverse of
102 .\"O .BR QM_DEPS .
103 .\"O The returned buffer consists of a sequence of null-terminated strings;
104 .\"O .I ret
105 .\"O is set to the number of modules.
106 指定されたモジュールを使用している全モジュールの名前を返す。
107 これは
108 .B QM_DEPS
109 と逆の機能である。
110 バッファには、NULL 終端された文字列が順に入る。
111 返されるバッファ
112 .I ret
113 にはモジュールの数が設定される。
114 .\" ret is set on ENOSPC
115 .TP
116 .B QM_SYMBOLS
117 .\"O Returns the symbols and values exported by the kernel or the indicated
118 .\"O module.
119 .\"O The returned buffer is an array of structures of the following form
120 カーネルまたは指定されたモジュールがエクスポートしているシンボルと
121 値を返す。
122 バッファのデータは、
123 以下の構造体の配列に NULL 終端された文字列が続く形となる。
124 .\" ret is set on ENOSPC
125 .in +4n
126 .nf
127
128 struct module_symbol {
129     unsigned long value;
130     unsigned long name;
131 };
132 .fi
133 .in
134 .IP
135 .\"O followed by null-terminated strings.
136 .\"O The value of
137 .\"O .I name
138 .\"O is the character offset of the string relative to the start of
139 .\"O .IR buf ;
140 .\"O .I ret
141 .\"O is set to the number of symbols.
142 .I name
143 の値は、
144 .I buf
145 の先頭からの文字列までのオフセット文字数である。
146 .I ret
147 にはシンボルの数が設定される。
148 .TP
149 .B QM_INFO
150 .\"O Returns miscellaneous information about the indicated module.
151 .\"O The output buffer format is:
152 指定されたモジュールに関する様々な情報を返す。
153 出力バッファのフォーマットは以下の形式となる:
154 .in +4n
155 .nf
156
157 struct module_info {
158     unsigned long address;
159     unsigned long size;
160     unsigned long flags;
161 };
162 .fi
163 .in
164 .IP
165 .\"O where
166 .\"O .I address
167 .\"O is the kernel address at which the module resides,
168 .\"O .I size
169 .\"O is the size of the module in bytes, and
170 .\"O .I flags
171 .\"O is a mask of
172 .\"O .BR MOD_RUNNING ,
173 .\"O .BR MOD_AUTOCLEAN ,
174 .\"O etc. that indicates the current status of the module
175 .\"O (see the kernel source file
176 .\"O .IR include/linux/module.h ).
177 .\"O .I ret
178 .\"O is set to the size of the
179 .\"O .I module_info
180 .\"O structure.
181 .I address
182 はそのモジュールが配置されているカーネル空間上のアドレス、
183 .I size
184 はそのモジュールのバイト単位のサイズ、
185 .I flags
186
187 .BR MOD_RUNNING ,
188 .B MOD_AUTOCLEAN
189 等のマスクであり、そのモジュールの現在の状態を示す
190 (カーネルのソースファイル
191 .I include/linux/module.h
192 を参照)。
193 .I ret
194 には
195 .I module_info
196 構造体のサイズが設定される。
197 .\"O .SH "RETURN VALUE"
198 .SH 返り値
199 .\"O On success, zero is returned.
200 .\"O On error, \-1 is returned and
201 .\"O .I errno
202 .\"O is set appropriately.
203 成功の場合 0 が返される。エラーの場合 \-1 が返され、
204 .I errno
205 に適切な値が設定される。
206 .\"O .SH ERRORS
207 .SH エラー
208 .TP
209 .B EFAULT
210 .\"O At least one of
211 .\"O .IR name ,
212 .\"O .IR buf ,
213 .\"O or
214 .\"O .I ret
215 .\"O was outside the program's accessible address space.
216 .IR name ,
217 .IR buf ,
218 .I ret
219 の少なくとも一つが、プログラムがアクセスできる
220 アドレス空間の外部であった。
221 .TP
222 .B EINVAL
223 .\"O Invalid
224 .\"O .IR which ;
225 .\"O or
226 .\"O .I name
227 .\"O is NULL (indicating "the kernel"),
228 .\"O but this is not permitted with the specified value of
229 .\"O .IR which .
230 .I which
231 が不正である。あるいは
232 .I name
233 が NULL だが (NULL は "カーネル" を示す)、
234 .I which
235 で指定された値との組み合わせは許可されていない。
236 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
237 .TP
238 .B ENOENT
239 .\"O No module by that
240 .\"O .I name
241 .\"O exists.
242 .I name
243 という名前のモジュールが存在しない。
244 .TP
245 .B ENOSPC
246 .\"O The buffer size provided was too small.
247 .\"O .I ret
248 .\"O is set to the minimum size needed.
249 与えられたバッファの大きさが小さすぎる。
250 .I ret
251 には最小限必要なバッファのサイズが設定される。
252 .TP
253 .B ENOSYS
254 .\"O .BR query_module ()
255 .\"O is not supported in this version of the kernel.
256 .BR query_module ()
257 はこのバージョンのカーネルではサポートされていない。
258 .\"O .SH "CONFORMING TO"
259 .SH 準拠
260 .\"O .BR query_module ()
261 .\"O is Linux-specific.
262 .BR query_module ()
263 は Linux 固有である。
264 .\"O .SH NOTES
265 .SH 注意
266 .\"O This system call is only present on Linux up until kernel 2.4;
267 .\"O it was removed in Linux 2.6.
268 .\"O .\" Removed in Linux-2.5.48
269 .\"O Some of the information that was available via
270 .\"O .BR query_module ()
271 .\"O can be obtained from
272 .\"O .IR /proc/modules ,
273 .\"O .IR /proc/kallsyms ,
274 .\"O and
275 .\"O .IR /sys/modules .
276 このシステムコールが存在するのはカーネル 2.4 までの Linux だけである。
277 Linux 2.6 では削除された。
278 .\" Removed in Linux 2.5.48
279 .BR query_module ()
280 で得られた情報のいくつかは、
281 .IR /proc/modules ,
282 .IR /proc/kallsyms ,
283 .I /sys/modules
284 から取得できる。
285 .\"O .SH "SEE ALSO"
286 .SH 関連項目
287 .BR create_module (2),
288 .BR delete_module (2),
289 .BR get_kernel_syms (2),
290 .BR init_module (2)