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.
5 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
6 .\" reformatting and rewordings by mtk
8 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
9 .\" Translated 2006-07-29, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
11 .TH QUERY_MODULE 2 2007-06-03 "Linux" "Linux Programmer's Manual"
14 .\"O query_module \- query the kernel for various bits pertaining to modules
15 query_module \- モジュールに関連する各種の情報をカーネルに問い合わせる
19 .B #include <linux/module.h>
21 .BI "int query_module(const char *" name ", int " which ", void *" buf ,
22 .BI " size_t " bufsize ", size_t *" ret );
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
30 .\"O The caller must specify the size of
34 .\"O The precise nature and format of the returned information
35 .\"O depend on the operation specified by
37 .\"O Some operations require
39 .\"O to identify a currently loaded module, some allow
41 .\"O to be NULL, indicating the kernel proper.
43 は、ローダブルモジュールに関する情報をカーネルに問い合わせる。
55 現在ロードされているモジュールを特定するために
58 カーネル固有であることを示す NULL を指定できる操作もある。
60 .\"O The following values can be specified for
66 .\"O Returns success, if the kernel supports
67 .\"O .BR query_module ().
68 .\"O Used to probe for availability of the system call.
72 このシステムコールが利用可能かを調べるために使われる。
75 .\"O Returns the names of all loaded modules.
76 .\"O The returned buffer consists of a sequence of null-terminated strings;
78 .\"O is set to the number of
80 ロードされている全てのモジュールの名前を返す。
81 バッファには、NULL 終端された文字列が順に入る。
85 .\" ret is set on ENOSPC
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;
91 .\"O is set to the number of modules.
92 指定されたモジュールが使用している全モジュールの名前を返す。
93 バッファには、NULL 終端された文字列が順に入る。
97 .\" ret is set on ENOSPC
100 .\"O Returns the names of all modules using the indicated module.
101 .\"O This is the inverse of
103 .\"O The returned buffer consists of a sequence of null-terminated strings;
105 .\"O is set to the number of modules.
106 指定されたモジュールを使用している全モジュールの名前を返す。
110 バッファには、NULL 終端された文字列が順に入る。
114 .\" ret is set on ENOSPC
117 .\"O Returns the symbols and values exported by the kernel or the indicated
119 .\"O The returned buffer is an array of structures of the following form
120 カーネルまたは指定されたモジュールがエクスポートしているシンボルと
123 以下の構造体の配列に NULL 終端された文字列が続く形となる。
124 .\" ret is set on ENOSPC
128 struct module_symbol {
135 .\"O followed by null-terminated strings.
138 .\"O is the character offset of the string relative to the start of
141 .\"O is set to the number of symbols.
145 の先頭からの文字列までのオフセット文字数である。
150 .\"O Returns miscellaneous information about the indicated module.
151 .\"O The output buffer format is:
152 指定されたモジュールに関する様々な情報を返す。
153 出力バッファのフォーマットは以下の形式となる:
158 unsigned long address;
167 .\"O is the kernel address at which the module resides,
169 .\"O is the size of the module in bytes, and
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 ).
178 .\"O is set to the size of the
182 はそのモジュールが配置されているカーネル空間上のアドレス、
189 等のマスクであり、そのモジュールの現在の状態を示す
191 .I include/linux/module.h
197 .\"O .SH "RETURN VALUE"
199 .\"O On success, zero is returned.
200 .\"O On error, \-1 is returned and
202 .\"O is set appropriately.
203 成功の場合 0 が返される。エラーの場合 \-1 が返され、
215 .\"O was outside the program's accessible address space.
219 の少なくとも一つが、プログラムがアクセスできる
227 .\"O is NULL (indicating "the kernel"),
228 .\"O but this is not permitted with the specified value of
233 が NULL だが (NULL は "カーネル" を示す)、
235 で指定された値との組み合わせは許可されていない。
236 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
239 .\"O No module by that
246 .\"O The buffer size provided was too small.
248 .\"O is set to the minimum size needed.
251 には最小限必要なバッファのサイズが設定される。
254 .\"O .BR query_module ()
255 .\"O is not supported in this version of the kernel.
257 はこのバージョンのカーネルではサポートされていない。
258 .\"O .SH "CONFORMING TO"
260 .\"O .BR query_module ()
261 .\"O is Linux-specific.
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 ,
275 .\"O .IR /sys/modules .
276 このシステムコールが存在するのはカーネル 2.4 までの Linux だけである。
278 .\" Removed in Linux 2.5.48
287 .BR create_module (2),
288 .BR delete_module (2),
289 .BR get_kernel_syms (2),