Penguin
Blame: init_module(2)
EditPageHistoryDiffInfoLikePages
Annotated edit history of init_module(2) version 4, including all changes. View license author blame.
Rev Author # Line
1 perry 1 INIT_MODULE
2 !!!INIT_MODULE
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 ERRORS
8 SEE ALSO
9 ----
10 !!NAME
11
12
13 init_module - initialize a loadable module entry
14 !!SYNOPSIS
15
16
17 __#include
18 __''name''__, struct module *__''image''__);
19 __
20 !!DESCRIPTION
21
22
23 __init_module__ loads the relocated module image into
24 kernel space and runs the module's ''init''
25 function.
26
27
28 The module image begins with a module structure and is
29 followed by code and data as appropriate. The module
30 structure is defined as follows:
31
32
33 struct module
34 {
35 unsigned long size_of_struct;
36 struct module *next;
37 const char *name;
38 unsigned long size;
39 long usecount;
40 unsigned long flags;
41 unsigned int nsyms;
42 unsigned int ndeps;
43 struct module_symbol *syms;
44 struct module_ref *deps;
45 struct module_ref *refs;
46 int (*init)(void);
47 void (*cleanup)(void);
48 const struct exception_table_entry *ex_table_start;
49 const struct exception_table_entry *ex_table_end;
50 #ifdef __alpha__
51 unsigned long gp;
52 #endif
53 };
54
55
56 All of the pointer fields, with the exception of ''next''
57 and ''refs'', are expected to point within the module
58 body and be initialized as appropriate for kernel space,
59 i.e. relocated with the rest of the module.
60
61
62 This system call is only open to the superuser.
63 !!RETURN VALUE
64
65
66 On success, zero is returned. On error, -1 is returned and
67 ''errno'' is set appropriately.
68 !!ERRORS
69
70
71 __EPERM__
72
73
74 The user is not the superuser.
75
76
77 __ENOENT__
78
79
80 No module by that name exists.
81
82
83 __EINVAL__
84
85
86 Some ''image'' slot filled in incorrectly,
87 ''image-'' does not correspond to the original
88 module name, some ''image-'' entry does not
89 correspond to a loaded module, or some other similar
90 inconsistency.
91
92
93 __EBUSY__
94
95
96 The module's initialization routine failed.
97
98
99 __EFAULT__
100
101
102 ''name'' or ''image'' is outside the program's
103 accessible address space.
104 !!SEE ALSO
105
106
4 perry 107 create_module(2), __delete_module__(2),
108 query_module(2).
1 perry 109 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.