OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man2 / query_module.2
1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
5 .\" %%%LICENSE_END
6 .\"
7 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
8 .\" reformatting and rewordings by mtk
9 .\"
10 .\"*******************************************************************
11 .\"
12 .\" This file was generated with po4a. Translate the source file.
13 .\"
14 .\"*******************************************************************
15 .TH QUERY_MODULE 2 2013\-01\-27 Linux "Linux Programmer's Manual"
16 .SH 名前
17 query_module \- モジュールに関連する各種の情報をカーネルに問い合わせる
18 .SH 書式
19 .nf
20 \fB#include <linux/module.h>\fP
21 .sp
22 \fBint query_module(const char *\fP\fIname\fP\fB, int \fP\fIwhich\fP\fB, void *\fP\fIbuf\fP\fB,\fP
23 \fB                 size_t \fP\fIbufsize\fP\fB, size_t *\fP\fIret\fP\fB);\fP
24 .fi
25
26 \fI注\fP: このシステムコールの glibc のラッパー関数はない。「注意」の節を参照。
27 .SH 説明
28 \fBNote\fP: This system call is present only in kernels before Linux 2.6.
29
30 \fBquery_module\fP()  は、ローダブルモジュールに関する情報をカーネルに問い合わせる。 情報は \fIbuf\fP
31 が指し示すバッファに格納されて返される。 呼び出し元は \fIbuf\fP のサイズを \fIbufsize\fP に指定しなければならない。
32 得られる情報の正確な意味とフォーマットは、 \fIwhich\fP でどの操作を指定するかによって異なる。 現在ロードされているモジュールを特定するために
33 \fIname\fP を必要とする操作があれば、 カーネル固有であることを示す NULL を指定できる操作もある。
34
35 \fIwhich\fP には以下の値を指定できる:
36 .TP 
37 \fB0\fP
38 カーネルが \fBquery_module\fP()  をサポートしている場合、成功を返す。 このシステムコールが利用可能かを調べるために使われる。
39 .TP 
40 \fBQM_MODULES\fP
41 .\" ret is set on ENOSPC
42 ロードされている全てのモジュールの名前を返す。 バッファには、NULL 終端された文字列が順に入る。 返されるバッファ \fIret\fP
43 にはモジュールの数が設定される。
44 .TP 
45 \fBQM_DEPS\fP
46 .\" ret is set on ENOSPC
47 指定されたモジュールが使用している全モジュールの名前を返す。 バッファには、NULL 終端された文字列が順に入る。 返されるバッファ \fIret\fP
48 にはモジュールの数が設定される。
49 .TP 
50 \fBQM_REFS\fP
51 .\" ret is set on ENOSPC
52 指定されたモジュールを使用している全モジュールの名前を返す。 これは \fBQM_DEPS\fP と逆の機能である。 バッファには、NULL
53 終端された文字列が順に入る。 返されるバッファ \fIret\fP にはモジュールの数が設定される。
54 .TP 
55 \fBQM_SYMBOLS\fP
56 .\" ret is set on ENOSPC
57 カーネルまたは指定されたモジュールがエクスポートしているシンボルと 値を返す。 バッファのデータは、 以下の構造体の配列に NULL
58 終端された文字列が続く形となる。
59 .in +4n
60 .nf
61
62 struct module_symbol {
63     unsigned long value;
64     unsigned long name;
65 };
66 .fi
67 .in
68 .IP
69 \fIname\fP の値は、 \fIbuf\fP の先頭からの文字列までのオフセット文字数である。 \fIret\fP にはシンボルの数が設定される。
70 .TP 
71 \fBQM_INFO\fP
72 指定されたモジュールに関する様々な情報を返す。 出力バッファのフォーマットは以下の形式となる:
73 .in +4n
74 .nf
75
76 struct module_info {
77     unsigned long address;
78     unsigned long size;
79     unsigned long flags;
80 };
81 .fi
82 .in
83 .IP
84 where \fIaddress\fP is the kernel address at which the module resides, \fIsize\fP
85 is the size of the module in bytes, and \fIflags\fP is a mask of
86 \fBMOD_RUNNING\fP, \fBMOD_AUTOCLEAN\fP, etc., that indicates the current status of
87 the module (see the Linux kernel source file \fIinclude/linux/module.h\fP).
88 \fIret\fP is set to the size of the \fImodule_info\fP structure.
89 .SH 返り値
90 成功の場合 0 が返される。エラーの場合 \-1 が返され、 \fIerrno\fP に適切な値が設定される。
91 .SH エラー
92 .TP 
93 \fBEFAULT\fP
94 \fIname\fP, \fIbuf\fP, \fIret\fP の少なくとも一つが、プログラムがアクセスできる アドレス空間の外部であった。
95 .TP 
96 \fBEINVAL\fP
97 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
98 \fIwhich\fP が不正である。あるいは \fIname\fP が NULL だが (NULL は "カーネル" を示す)、 \fIwhich\fP
99 で指定された値との組み合わせは許可されていない。
100 .TP 
101 \fBENOENT\fP
102 \fIname\fP という名前のモジュールが存在しない。
103 .TP 
104 \fBENOSPC\fP
105 与えられたバッファの大きさが小さすぎる。 \fIret\fP には最小限必要なバッファのサイズが設定される。
106 .TP 
107 \fBENOSYS\fP
108 \fBquery_module\fP()  is not supported in this version of the kernel (e.g., the
109 kernel is version 2.6 or later).
110 .SH バージョン
111 .\" Removed in Linux 2.5.48
112 このシステムコールが存在するのはカーネル 2.4 までの Linux だけである。 Linux 2.6 では削除された。
113 .SH 準拠
114 \fBquery_module\fP()  は Linux 固有である。
115 .SH 注意
116 Some of the information that was formerly available via \fBquery_module\fP()
117 can be obtained from \fI/proc/modules\fP, \fI/proc/kallsyms\fP, and the files
118 under the directory \fI/sys/module\fP.
119
120 Glibc does not provide a wrapper for this system call; in the unlikely event
121 that you need to use it on an old kernel, use \fBsyscall\fP(2).
122 .SH 関連項目
123 \fBcreate_module\fP(2), \fBdelete_module\fP(2), \fBget_kernel_syms\fP(2),
124 \fBinit_module\fP(2), \fBlsmod\fP(8), \fBmodinfo\fP(8)
125 .SH この文書について
126 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
127 である。プロジェクトの説明とバグ報告に関する情報は
128 http://www.kernel.org/doc/man\-pages/ に書かれている。