OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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)