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 ¤Ï¡¢¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥«¡¼¥Í¥ë¤ËÌ䤤¹ç¤ï¤»¤ë¡£
46 ¤¬»Ø¤·¼¨¤¹¥Ð¥Ã¥Õ¥¡¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£
51 ¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
52 ÆÀ¤é¤ì¤ë¾ðÊó¤ÎÀµ³Î¤Ê°ÕÌ£¤È¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢
54 ¤Ç¤É¤ÎÁàºî¤ò»ØÄꤹ¤ë¤«¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
55 ¸½ºß¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥â¥¸¥å¡¼¥ë¤òÆÃÄꤹ¤ë¤¿¤á¤Ë
57 ¤òɬÍפȤ¹¤ëÁàºî¤¬¤¢¤ì¤Ð¡¢
58 ¥«¡¼¥Í¥ë¸ÇͤǤ¢¤ë¤³¤È¤ò¼¨¤¹ NULL ¤ò»ØÄê¤Ç¤¤ëÁàºî¤â¤¢¤ë¡£
60 .\"O The following values can be specified for
63 ¤Ë¤Ï°Ê²¼¤ÎÃͤò»ØÄê¤Ç¤¤ë:
66 .\"O Returns success, if the kernel supports
67 .\"O .BR query_module ().
68 .\"O Used to probe for availability of the system call.
71 ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡¢À®¸ù¤òÊÖ¤¹¡£
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 ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£
84 ¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£
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 ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£
96 ¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£
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 ½ªÃ¼¤µ¤ì¤¿Ê¸»úÎ󤬽ç¤ËÆþ¤ë¡£
113 ¤Ë¤Ï¥â¥¸¥å¡¼¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£
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 ¤ÎÀèƬ¤«¤é¤Îʸ»úÎó¤Þ¤Ç¤Î¥ª¥Õ¥»¥Ã¥Èʸ»ú¿ô¤Ç¤¢¤ë¡£
147 ¤Ë¤Ï¥·¥ó¥Ü¥ë¤Î¿ô¤¬ÀßÄꤵ¤ì¤ë¡£
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 ¤Ï¤½¤Î¥â¥¸¥å¡¼¥ë¤¬ÇÛÃÖ¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¶õ´Ö¾å¤Î¥¢¥É¥ì¥¹¡¢
184 ¤Ï¤½¤Î¥â¥¸¥å¡¼¥ë¤Î¥Ð¥¤¥Èñ°Ì¤Î¥µ¥¤¥º¡¢
189 Åù¤Î¥Þ¥¹¥¯¤Ç¤¢¤ê¡¢¤½¤Î¥â¥¸¥å¡¼¥ë¤Î¸½ºß¤Î¾õÂÖ¤ò¼¨¤¹
190 (¥«¡¼¥Í¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë
191 .I include/linux/module.h
196 ¹½Â¤ÂΤΥµ¥¤¥º¤¬ÀßÄꤵ¤ì¤ë¡£
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 ¤¬ÊÖ¤µ¤ì¡¢
205 ¤ËŬÀÚ¤ÊÃͤ¬ÀßÄꤵ¤ì¤ë¡£
215 .\"O was outside the program's accessible address space.
219 ¤Î¾¯¤Ê¤¯¤È¤â°ì¤Ä¤¬¡¢¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤¤ë
220 ¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ç¤¢¤Ã¤¿¡£
227 .\"O is NULL (indicating "the kernel"),
228 .\"O but this is not permitted with the specified value of
231 ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£¤¢¤ë¤¤¤Ï
233 ¤¬ NULL ¤À¤¬ (NULL ¤Ï "¥«¡¼¥Í¥ë" ¤ò¼¨¤¹)¡¢
235 ¤Ç»ØÄꤵ¤ì¤¿ÃͤȤÎÁȤ߹ç¤ï¤»¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
236 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
239 .\"O No module by that
243 ¤È¤¤¤¦Ì¾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£
246 .\"O The buffer size provided was too small.
248 .\"O is set to the minimum size needed.
249 Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礤µ¤¬¾®¤µ¤¹¤®¤ë¡£
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.
263 ¤Ï Linux ¸ÇͤǤ¢¤ë¡£
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 ¤À¤±¤Ç¤¢¤ë¡£
277 Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£
278 .\" Removed in Linux 2.5.48
280 ¤ÇÆÀ¤é¤ì¤¿¾ðÊó¤Î¤¤¤¯¤Ä¤«¤Ï¡¢
287 .BR create_module (2),
288 .BR delete_module (2),
289 .BR get_kernel_syms (2),