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-31, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
11 .TH GET_KERNEL_SYMS 2 2007-06-03 "Linux" "Linux Programmer's Manual"
14 .\"O get_kernel_syms \- retrieve exported kernel and module symbols
15 get_kernel_syms \- ¸ø³«¤µ¤ì¤Æ¤¤¤ë¥«¡¼¥Í¥ë¤ä¥â¥¸¥å¡¼¥ë¤Î¥·¥ó¥Ü¥ë¤Î¼èÆÀ
19 .B #include <linux/module.h>
21 .BI "int get_kernel_syms(struct kernel_sym *" table );
28 .\"O .BR get_kernel_syms ()
29 .\"O returns the number of symbols available for query.
30 .\"O Otherwise it fills in a table of structures:
31 .BR get_kernel_syms ()
35 Ì䤤¹ç¤ï¤»¤Ç¤¤ë¥·¥ó¥Ü¥ë¤Î¿ô¤òÊÖ¤¹¡£
36 NULL °Ê³°¤Î¾ì¹ç¡¢°Ê²¼¤Î¹½Â¤ÂΤÎÎó (table) ¤ËÃͤòÆþ¤ì¤ÆÊÖ¤¹¡£
47 .\"O The symbols are interspersed with magic symbols of the form
48 .\"O .BI # module-name
49 .\"O with the kernel having an empty name.
50 .\"O The value associated with a symbol of this form is the address at
51 .\"O which the module is loaded.
54 ¤È¤¤¤¦·Á¼°¤Î¡¢¥«¡¼¥Í¥ë¤¬¶õ¤Î̾Á°¤ò»ý¤Ã¤Æ¤¤¤ë¥Þ¥¸¥Ã¥¯¥·¥ó¥Ü¥ë
55 (magic symbol) ¤¬»¶ºß¤·¤Æ¤¤¤ë¡£¤³¤Î·Á¼°¤Î¥·¥ó¥Ü¥ë¤ËÂбþ¤¹¤ëÃͤÏ
56 ¥â¥¸¥å¡¼¥ë¤¬¥í¡¼¥É¤µ¤ì¤¿¥¢¥É¥ì¥¹¤È¤Ê¤ë¡£
58 .\"O The symbols exported from each module follow their magic module tag
59 .\"O and the modules are returned in the reverse of the
60 .\"O order in which they were loaded.
61 ¸Ä¡¹¤Î¥â¥¸¥å¡¼¥ë¤«¤é¸ø³« (export) ¤µ¤ì¤¿¥·¥ó¥Ü¥ë¤Ï¡¢¥Þ¥¸¥Ã¥¯¥â¥¸¥å¡¼¥ë¥¿¥°
62 ¤Î¸å¤í¤ËÃÖ¤«¤ì¤ë¡£¤Þ¤¿¡¢¥â¥¸¥å¡¼¥ë¤Ï¥í¡¼¥É¤µ¤ì¤¿½çÈ֤Ȥϵսç¤ÇÊÖ¤µ¤ì¤ë¡£
63 .\"O .SH "RETURN VALUE"
65 .\"O On success, returns the number of symbols copied to
67 .\"O On error, \-1 is returned and
69 .\"O is set appropriately.
72 ¤Ë¥³¥Ô¡¼¤µ¤ì¤¿¥·¥ó¥Ü¥ë¿ô¤òÊÖ¤¹¡£
73 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
78 .\"O There is only one possible error return:
79 ÊÖ¤ë²ÄǽÀ¤¬¤¢¤ë¥¨¥é¡¼¤Ï°ì¤Ä¤À¤±¤Ç¤¢¤ë¡£
82 .\"O .BR get_kernel_syms ()
83 .\"O is not supported in this version of the kernel.
84 .BR get_kernel_syms ()
85 ¤¬¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
88 .\"O This system call is only present on Linux up until kernel 2.4;
89 .\"O it was removed in Linux 2.6.
90 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¤Î¤Ï¥«¡¼¥Í¥ë 2.4 ¤Þ¤Ç¤Î Linux ¤À¤±¤Ç¤¢¤ë¡£
91 Linux 2.6 ¤Ç¤Ïºï½ü¤µ¤ì¤¿¡£
92 .\" Removed in Linux 2.5.48
93 .\"O .SH "CONFORMING TO"
95 .\"O .BR get_kernel_syms ()
96 .\"O is Linux-specific.
97 .BR get_kernel_syms ()
101 .\"O There is no way to indicate the size of the buffer allocated for
103 .\"O If symbols have been added to the kernel since the
104 .\"O program queried for the symbol table size, memory will be corrupted.
106 ÍѤ˳ÎÊݤ·¤¿¥Ð¥Ã¥Õ¥¡¤ÎÂ礤µ¤òÅÁ¤¨¤ëÊýË¡¤¬¤Ê¤¤¡£
107 ¥×¥í¥°¥é¥à¤¬¥·¥ó¥Ü¥ë¥Æ¡¼¥Ö¥ë¤ÎÂ礤µ¤òÌ䤤¹ç¤ï¤»¤¿¸å¤Ë¡¢¥«¡¼¥Í¥ë¤Ë
108 ¥·¥ó¥Ü¥ë¤¬Äɲ䵤ì¤ë¤È¡¢¥á¥â¥ê¤ÎÆâÍƤ¬Ç˲õ¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£
110 .\"O The length of exported symbol names is limited to 59 characters.
111 ¸ø³«¤µ¤ì¤ë¥·¥ó¥Ü¥ë̾¤ÎŤµ¤¬ 59 ʸ»ú¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£
113 .\"O Because of these limitations, this system call is deprecated in
115 .\"O .BR query_module (2)
116 .\"O (which is itself nowadays deprecated
117 .\"O in favor of other interfaces described on its manual page).
118 ¤³¤ì¤é¤ÎÀ©¸Â¤¬¤¢¤ë¤Î¤Ç¡¢¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤è¤ê¤Ï
123 ¼«¿È¤â¤½¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¤è¤¦¤Ë
124 ¾¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»È¤¦¤Î¤¬Ë¾¤Þ¤·¤¤¤È¤µ¤ì¤Æ¤¤¤ë)¡£
127 .BR create_module (2),
128 .BR delete_module (2),