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 .TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual"
10 init_module \- initialize a loadable module entry
13 .B #include <linux/module.h>
15 .BI "int init_module(const char *" name ", struct module *" image );
19 loads the relocated module image into kernel space and runs the
24 The module image begins with a module structure and is followed by
25 code and data as appropriate.
26 The module structure is defined as follows:
31 unsigned long size_of_struct;
39 struct module_symbol *syms;
40 struct module_ref *deps;
41 struct module_ref *refs;
43 void (*cleanup)(void);
44 const struct exception_table_entry *ex_table_start;
45 const struct exception_table_entry *ex_table_end;
53 All of the pointer fields, with the exception of
57 are expected to point within the module body and be
58 initialized as appropriate for kernel space, that is, relocated with
59 the rest of the module.
61 This system call requires privilege.
63 On success, zero is returned.
64 On error, \-1 is returned and
70 The module's initialization routine failed.
76 is outside the program's accessible address space.
81 slot is filled in incorrectly,
83 does not correspond to the original module name, some
85 entry does not correspond to a loaded module,
86 or some other similar inconsistency.
89 No module by that name exists.
92 The caller was not privileged
100 .BR create_module (2),
101 .BR delete_module (2),