1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2013-04-30 20:29+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=CHARSET\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: build/C/man2/create_module.2:10
26 #: build/C/man2/create_module.2:10 build/C/man2/get_kernel_syms.2:10
32 #: build/C/man2/create_module.2:10 build/C/man2/delete_module.2:25 build/C/man2/get_kernel_syms.2:10 build/C/man2/init_module.2:27 build/C/man2/query_module.2:10
38 #: build/C/man2/create_module.2:10 build/C/man2/delete_module.2:25 build/C/man2/get_kernel_syms.2:10 build/C/man2/init_module.2:27 build/C/man2/query_module.2:10
40 msgid "Linux Programmer's Manual"
44 #: build/C/man2/create_module.2:11 build/C/man2/delete_module.2:26 build/C/man2/get_kernel_syms.2:11 build/C/man2/init_module.2:28 build/C/man2/query_module.2:11
50 #: build/C/man2/create_module.2:13
51 msgid "create_module - create a loadable module entry"
55 #: build/C/man2/create_module.2:13 build/C/man2/delete_module.2:28 build/C/man2/get_kernel_syms.2:13 build/C/man2/init_module.2:30 build/C/man2/query_module.2:13
61 #: build/C/man2/create_module.2:16 build/C/man2/get_kernel_syms.2:16 build/C/man2/query_module.2:16
63 msgid "B<#include E<lt>linux/module.hE<gt>>\n"
67 #: build/C/man2/create_module.2:18
69 msgid "B<caddr_t create_module(const char *>I<name>B<, size_t >I<size>B<);>\n"
73 #: build/C/man2/create_module.2:19 build/C/man2/delete_module.2:35 build/C/man2/get_kernel_syms.2:19 build/C/man2/init_module.2:41 build/C/man2/query_module.2:23
79 #: build/C/man2/create_module.2:22 build/C/man2/get_kernel_syms.2:22 build/C/man2/query_module.2:26
80 msgid "B<Note>: This system call is present only in kernels before Linux 2.6."
84 #: build/C/man2/create_module.2:27
86 "B<create_module>() attempts to create a loadable module entry and reserve "
87 "the kernel memory that will be needed to hold the module. This system call "
92 #: build/C/man2/create_module.2:27 build/C/man2/delete_module.2:124 build/C/man2/get_kernel_syms.2:48 build/C/man2/init_module.2:150 build/C/man2/query_module.2:129
98 #: build/C/man2/create_module.2:32
100 "On success, returns the kernel address at which the module will reside. On "
101 "error -1 is returned and I<errno> is set appropriately."
105 #: build/C/man2/create_module.2:32 build/C/man2/delete_module.2:129 build/C/man2/get_kernel_syms.2:54 build/C/man2/init_module.2:155 build/C/man2/query_module.2:134
111 #: build/C/man2/create_module.2:33 build/C/man2/init_module.2:194
117 #: build/C/man2/create_module.2:36
118 msgid "A module by that name already exists."
122 #: build/C/man2/create_module.2:36 build/C/man2/delete_module.2:143 build/C/man2/init_module.2:162 build/C/man2/query_module.2:135
128 #: build/C/man2/create_module.2:40
129 msgid "I<name> is outside the program's accessible address space."
133 #: build/C/man2/create_module.2:40 build/C/man2/init_module.2:197 build/C/man2/init_module.2:232 build/C/man2/query_module.2:143
139 #: build/C/man2/create_module.2:43
140 msgid "The requested size is too small even for the module header information."
144 #: build/C/man2/create_module.2:43 build/C/man2/init_module.2:177
150 #: build/C/man2/create_module.2:47
152 "The kernel could not allocate a contiguous block of memory large enough for "
157 #: build/C/man2/create_module.2:47 build/C/man2/get_kernel_syms.2:56 build/C/man2/query_module.2:163
163 #: build/C/man2/create_module.2:52
165 "B<create_module>() is not supported in this version of the kernel (e.g., "
166 "the kernel is version 2.6 or later)."
170 #: build/C/man2/create_module.2:52 build/C/man2/delete_module.2:150 build/C/man2/init_module.2:180
176 #: build/C/man2/create_module.2:58
178 "The caller was not privileged (did not have the B<CAP_SYS_MODULE> "
183 #: build/C/man2/create_module.2:58 build/C/man2/get_kernel_syms.2:60 build/C/man2/init_module.2:252 build/C/man2/query_module.2:168
188 #. Removed in Linux 2.5.48
190 #: build/C/man2/create_module.2:62 build/C/man2/get_kernel_syms.2:64 build/C/man2/query_module.2:172
192 "This system call is present on Linux only up until kernel 2.4; it was "
193 "removed in Linux 2.6."
197 #: build/C/man2/create_module.2:62 build/C/man2/delete_module.2:172 build/C/man2/get_kernel_syms.2:64 build/C/man2/init_module.2:255 build/C/man2/query_module.2:172
199 msgid "CONFORMING TO"
203 #: build/C/man2/create_module.2:65
204 msgid "B<create_module>() is Linux-specific."
208 #: build/C/man2/create_module.2:65 build/C/man2/delete_module.2:202 build/C/man2/get_kernel_syms.2:80 build/C/man2/init_module.2:337 build/C/man2/query_module.2:187
214 #: build/C/man2/create_module.2:69
215 msgid "B<delete_module>(2), B<init_module>(2), B<query_module>(2)"
219 #: build/C/man2/create_module.2:69 build/C/man2/delete_module.2:209 build/C/man2/get_kernel_syms.2:85 build/C/man2/init_module.2:343 build/C/man2/query_module.2:194
225 #: build/C/man2/create_module.2:76 build/C/man2/delete_module.2:216 build/C/man2/get_kernel_syms.2:92 build/C/man2/init_module.2:350 build/C/man2/query_module.2:201
227 "This page is part of release 3.51 of the Linux I<man-pages> project. A "
228 "description of the project, and information about reporting bugs, can be "
229 "found at http://www.kernel.org/doc/man-pages/."
233 #: build/C/man2/delete_module.2:25
235 msgid "DELETE_MODULE"
239 #: build/C/man2/delete_module.2:25
245 #: build/C/man2/delete_module.2:28
246 msgid "delete_module - unload a kernel module"
250 #: build/C/man2/delete_module.2:31
252 msgid "B<int delete_module(const char *>I<name>B<, int >I<flags>B<);>\n"
256 #: build/C/man2/delete_module.2:35 build/C/man2/query_module.2:23
257 msgid "I<Note>: There is no glibc wrapper for this system call; see NOTES."
261 #: build/C/man2/delete_module.2:49
263 "The B<delete_module>() system call attempts to remove the unused loadable "
264 "module entry identified by I<name>. If the module has an I<exit> function, "
265 "then that function is executed before unloading the module. The I<flags> "
266 "argument is used to modify the behavior of the system call, as described "
267 "below. This system call requires privilege."
271 #: build/C/man2/delete_module.2:51
272 msgid "Module removal is attempted according to the following rules:"
276 #: build/C/man2/delete_module.2:51
282 #: build/C/man2/delete_module.2:55
284 "If there are other loaded modules that depend on (i.e., refer to symbols "
285 "defined in) this module, then the call fails."
289 #: build/C/man2/delete_module.2:55
295 #: build/C/man2/delete_module.2:59
297 "Otherwise, if the reference count for the module (i.e., the number of "
298 "processes currently using the module) is zero, then the module is "
299 "immediately unloaded."
303 #: build/C/man2/delete_module.2:59
308 #. O_TRUNC == KMOD_REMOVE_FORCE in kmod library
309 #. O_NONBLOCK == KMOD_REMOVE_NOWAIT in kmod library
311 #: build/C/man2/delete_module.2:70
313 "If a module has a nonzero reference count, then the behavior depends on the "
314 "bits set in I<flags>. In normal usage (see NOTES), the B<O_NONBLOCK> flag "
315 "is always specified, and the B<O_TRUNC> flag may additionally be specified."
319 #: build/C/man2/delete_module.2:74
320 msgid "The various combinations for I<flags> have the following effect:"
324 #: build/C/man2/delete_module.2:75
326 msgid "B<flags == O_NONBLOCK>"
330 #: build/C/man2/delete_module.2:78
331 msgid "The call returns immediately, with an error."
335 #: build/C/man2/delete_module.2:78
337 msgid "B<flags == (O_NONBLOCK | O_TRUNC)>"
341 #: build/C/man2/delete_module.2:82
343 "The module is unloaded immediately, regardless of whether it has a nonzero "
348 #: build/C/man2/delete_module.2:82
350 msgid "B<(flags & O_NONBLOCK) == 0>"
354 #: build/C/man2/delete_module.2:89
355 msgid "If I<flags> does not specify B<O_NONBLOCK>, the following steps occur:"
359 #: build/C/man2/delete_module.2:90 build/C/man2/delete_module.2:92 build/C/man2/delete_module.2:97
365 #: build/C/man2/delete_module.2:92
366 msgid "The module is marked so that no new references are permitted."
370 #: build/C/man2/delete_module.2:97
372 "If the module's reference count is nonzero, the caller is placed in an "
373 "uninterruptible sleep state (B<TASK_UNINTERRUPTIBLE>) until the reference "
374 "count is zero, at which point the call unblocks."
378 #: build/C/man2/delete_module.2:99
379 msgid "The module is unloaded in the usual way."
383 #: build/C/man2/delete_module.2:113
385 "The B<O_TRUNC> flag has one further effect on the rules described above. By "
386 "default, if a module has an I<init> function but no I<exit> function, then "
387 "an attempt to remove the module will fail. However, if B<O_TRUNC> was "
388 "specified, this requirement is bypassed."
392 #: build/C/man2/delete_module.2:124
394 "Using the B<O_TRUNC> flag is dangerous! If the kernel was not built with "
395 "B<CONFIG_MODULE_FORCE_UNLOAD>, this flag is silently ignored. (Normally, "
396 "B<CONFIG_MODULE_FORCE_UNLOAD> is enabled.) Using this flag taints the "
397 "kernel (TAINT_FORCED_RMMOD)."
401 #: build/C/man2/delete_module.2:129 build/C/man2/query_module.2:134
403 "On success, zero is returned. On error, -1 is returned and I<errno> is set "
408 #: build/C/man2/delete_module.2:130 build/C/man2/init_module.2:159
414 #: build/C/man2/delete_module.2:143
416 "The module is not \"live\" (i.e., it is still being initialized or is "
417 "already marked for removal); or, the module has an I<init> function but has "
418 "no I<exit> function, and B<O_TRUNC> was not specified in I<flags>."
422 #: build/C/man2/delete_module.2:147
423 msgid "I<name> refers to a location outside the process's accessible address space."
427 #: build/C/man2/delete_module.2:147 build/C/man2/query_module.2:153
433 #: build/C/man2/delete_module.2:150
434 msgid "No module by that name exists."
438 #: build/C/man2/delete_module.2:161
440 "The caller was not privileged (did not have the B<CAP_SYS_MODULE> "
441 "capability), or module unloading is disabled (see "
442 "I</proc/sys/kernel/modules_disabled> in B<proc>(5))."
446 #: build/C/man2/delete_module.2:161
448 msgid "B<EWOULDBLOCK>"
452 #: build/C/man2/delete_module.2:172
454 "Other modules depend on this module; or, B<O_NONBLOCK> was specified in "
455 "I<flags>, but the reference count of this module is nonzero and B<O_TRUNC> "
456 "was not specified in I<flags>."
460 #: build/C/man2/delete_module.2:175
461 msgid "B<delete_module>() is Linux-specific."
465 #: build/C/man2/delete_module.2:175 build/C/man2/init_module.2:260 build/C/man2/query_module.2:175
471 #: build/C/man2/delete_module.2:178
473 "Glibc does not provide a wrapper for this system call; call it using "
478 #: build/C/man2/delete_module.2:188
480 "The uninterruptible sleep that may occur if B<O_NONBLOCK> is omitted from "
481 "I<flags> is considered undesirable, because the sleeping process is left in "
482 "an unkillable state. As at Linux 3.7, specifying B<O_NONBLOCK> is optional, "
483 "but in future kernels it is likely to become mandatory."
487 #: build/C/man2/delete_module.2:188 build/C/man2/init_module.2:272
489 msgid "Linux 2.4 and earlier"
493 #: build/C/man2/delete_module.2:190
494 msgid "In Linux 2.4 and earlier, the system call took only one argument:"
498 #: build/C/man2/delete_module.2:192
499 msgid "B< int delete_module(const char *>I<name>B<);>"
503 #: build/C/man2/delete_module.2:196
504 msgid "If I<name> is NULL, all unused modules marked auto-clean are removed."
508 #: build/C/man2/delete_module.2:202
510 "Some further details of differences in the behavior of B<delete_module>() "
511 "in Linux 2.4 and earlier are I<not> currently explained in this manual page."
515 #: build/C/man2/delete_module.2:209
517 "B<create_module>(2), B<init_module>(2), B<query_module>(2), B<lsmod>(8), "
518 "B<modprobe>(8), B<rmmod>(8)"
522 #: build/C/man2/get_kernel_syms.2:10
524 msgid "GET_KERNEL_SYMS"
528 #: build/C/man2/get_kernel_syms.2:13
529 msgid "get_kernel_syms - retrieve exported kernel and module symbols"
533 #: build/C/man2/get_kernel_syms.2:18
535 msgid "B<int get_kernel_syms(struct kernel_sym *>I<table>B<);>\n"
539 #: build/C/man2/get_kernel_syms.2:29
541 "If I<table> is NULL, B<get_kernel_syms>() returns the number of symbols "
542 "available for query. Otherwise it fills in a table of structures:"
546 #: build/C/man2/get_kernel_syms.2:36
549 "struct kernel_sym {\n"
550 " unsigned long value;\n"
556 #: build/C/man2/get_kernel_syms.2:44
558 "The symbols are interspersed with magic symbols of the form "
559 "B<#>I<module-name> with the kernel having an empty name. The value "
560 "associated with a symbol of this form is the address at which the module is "
565 #: build/C/man2/get_kernel_syms.2:48
567 "The symbols exported from each module follow their magic module tag and the "
568 "modules are returned in the reverse of the order in which they were loaded."
572 #: build/C/man2/get_kernel_syms.2:54
574 "On success, returns the number of symbols copied to I<table>. On error, -1 "
575 "is returned and I<errno> is set appropriately."
579 #: build/C/man2/get_kernel_syms.2:56
580 msgid "There is only one possible error return:"
584 #: build/C/man2/get_kernel_syms.2:60
585 msgid "B<get_kernel_syms>() is not supported in this version of the kernel."
589 #: build/C/man2/get_kernel_syms.2:67
590 msgid "B<get_kernel_syms>() is Linux-specific."
594 #: build/C/man2/get_kernel_syms.2:67
600 #: build/C/man2/get_kernel_syms.2:72
602 "There is no way to indicate the size of the buffer allocated for I<table>. "
603 "If symbols have been added to the kernel since the program queried for the "
604 "symbol table size, memory will be corrupted."
608 #: build/C/man2/get_kernel_syms.2:74
609 msgid "The length of exported symbol names is limited to 59 characters."
613 #: build/C/man2/get_kernel_syms.2:80
615 "Because of these limitations, this system call is deprecated in favor of "
616 "B<query_module>(2) (which is itself nowadays deprecated in favor of other "
617 "interfaces described on its manual page)."
621 #: build/C/man2/get_kernel_syms.2:85
623 "B<create_module>(2), B<delete_module>(2), B<init_module>(2), "
628 #: build/C/man2/init_module.2:27
634 #: build/C/man2/init_module.2:27
640 #: build/C/man2/init_module.2:30
641 msgid "init_module, finit_module - load a kernel module"
645 #: build/C/man2/init_module.2:34
648 "B<int init_module(void *>I<module_image>B<, unsigned long >I<len>B<,>\n"
649 "B< const char *>I<param_values>B<);>\n"
653 #: build/C/man2/init_module.2:37
656 "B<int finit_module(int >I<fd>B<, const char *>I<param_values>B<,>\n"
657 "B< int >I<flags>B<);>\n"
661 #: build/C/man2/init_module.2:41
662 msgid "I<Note>: There are no glibc wrappers for these system calls; see NOTES."
666 #: build/C/man2/init_module.2:50
668 "B<init_module>() loads an ELF image into kernel space, performs any "
669 "necessary symbol relocations, initializes module parameters to values "
670 "provided by the caller, and then runs the module's I<init> function. This "
671 "system call requires privilege."
675 #: build/C/man2/init_module.2:58
677 "The I<module_image> argument points to a buffer containing the binary image "
678 "to be loaded; I<len> specifies the size of that buffer. The module image "
679 "should be a valid ELF image, built for the running kernel."
683 #: build/C/man2/init_module.2:69
685 "The I<param_values> argument is a string containing space-delimited "
686 "specifications of the values for module parameters (defined inside the "
687 "module using B<module_param>() and B<module_param_array>()). The kernel "
688 "parses this string and initializes the specified parameters. Each of the "
689 "parameter specifications has the form:"
693 #: build/C/man2/init_module.2:74
694 msgid "I<name>[B<=>I<value>[B<,>I<value>...]]"
698 #: build/C/man2/init_module.2:89
700 "The parameter I<name> is one of those defined within the module using "
701 "I<module_param>() (see the Linux kernel source file "
702 "I<include/linux/moduleparam.h>). The parameter I<value> is optional in the "
703 "case of I<bool> and I<invbool> parameters. Values for array parameters are "
704 "specified as a comma-separated list."
708 #: build/C/man2/init_module.2:89
710 msgid "finit_module()"
713 #. commit 34e1169d996ab148490c01b65b4ee371cf8ffba2
714 #. https://lwn.net/Articles/519010/
716 #: build/C/man2/init_module.2:107
718 "The B<finit_module>() system call is like B<init_module>(), but reads the "
719 "module to be loaded from the file descriptor I<fd>. It is useful when the "
720 "authenticity of a kernel module can be determined from its location in the "
721 "file system; in cases where that is possible, the overhead of using "
722 "cryptographically signed modules to determine the authenticity of a module "
723 "can be avoided. The I<param_values> argument is as for B<init_module>()."
726 #. commit 2f3238aebedb243804f58d62d57244edec4149b2
728 #: build/C/man2/init_module.2:115
730 "The I<flags> argument modifies the operation of B<finit_module>(). It is a "
731 "bit mask value created by ORing together zero or more of the following "
736 #: build/C/man2/init_module.2:115
738 msgid "B<MODULE_INIT_IGNORE_MODVERSIONS>"
742 #: build/C/man2/init_module.2:118
743 msgid "Ignore symbol version hashes."
747 #: build/C/man2/init_module.2:118
749 msgid "B<MODULE_INIT_IGNORE_VERMAGIC>"
753 #: build/C/man2/init_module.2:121
754 msgid "Ignore kernel version magic."
757 #. http://www.tldp.org/HOWTO/Module-HOWTO/basekerncompat.html
758 #. is dated, but informative
760 #: build/C/man2/init_module.2:139
762 "There are some safety checks built into a module to ensure that it matches "
763 "the kernel against which it is loaded. These checks are recorded when the "
764 "module is built and verified when the module is loaded. First, the module "
765 "records a \"vermagic\" string containing the kernel version number and "
766 "prominent features (such as the CPU type). Second, if the module was built "
767 "with the B<CONFIG_MODVERSIONS> configuration option enabled, a version hash "
768 "is recorded for each symbol the module uses. This hash is based on the "
769 "types of the arguments and return value for the function named by the "
770 "symbol. In this case, the kernel version number within the \"vermagic\" "
771 "string is ignored, as the symbol version hashes are assumed to be "
772 "sufficiently reliable."
776 #: build/C/man2/init_module.2:150
778 "Using the B<MODULE_INIT_IGNORE_VERMAGIC> flag indicates that the "
779 "\"vermagic\" string is to be ignored, and the "
780 "B<MODULE_INIT_IGNORE_MODVERSIONS> flag indicates that the symbol version "
781 "hashes are to be ignored. If the kernel is built to permit forced loading "
782 "(i.e., configured with B<CONFIG_MODULE_FORCE_LOAD>), then loading will "
783 "continue, otherwise it will fail with B<ENOEXEC> as expected for malformed "
788 #: build/C/man2/init_module.2:155
790 "On success, these system calls return 0. On error, -1 is returned and "
791 "I<errno> is set appropriately."
795 #: build/C/man2/init_module.2:156
797 msgid "B<EBADMSG> (since Linux 3.7)"
801 #: build/C/man2/init_module.2:159
802 msgid "Module signature is misformatted."
806 #: build/C/man2/init_module.2:162
807 msgid "Timeout while trying to resolve a symbol reference by this module."
811 #: build/C/man2/init_module.2:166
813 "An address argument referred to a location that is outside the process's "
814 "accessible address space."
818 #: build/C/man2/init_module.2:166
820 msgid "B<ENOKEY> (since Linux 3.7)"
823 #. commit 48ba2462ace6072741fd8d0058207d630ce93bf1
824 #. commit 1d0059f3a468825b5fc5405c636a2f6e02707ffa
825 #. commit 106a4ee258d14818467829bf0e12aeae14c16cd7
827 #: build/C/man2/init_module.2:177
829 "Module signature is invalid or the kernel does not have a key for this "
830 "module. This error is returned only if the kernel was configured with "
831 "B<CONFIG_MODULE_SIG_FORCE>; if the kernel was not configured with this "
832 "option, then an invalid or unsigned module simply taints the kernel."
836 #: build/C/man2/init_module.2:180
837 msgid "Out of memory."
841 #: build/C/man2/init_module.2:191
843 "The caller was not privileged (did not have the B<CAP_SYS_MODULE> "
844 "capability), or module loading is disabled (see "
845 "I</proc/sys/kernel/modules_disabled> in B<proc>(5))."
849 #: build/C/man2/init_module.2:194
850 msgid "The following errors may additionally occur for B<init_module>():"
854 #: build/C/man2/init_module.2:197
855 msgid "A module with this name is already loaded."
859 #. .BR EINVAL " (Linux 2.4 and earlier)"
862 #. slot is filled in incorrectly,
864 #. does not correspond to the original module name, some
866 #. entry does not correspond to a loaded module,
867 #. or some other similar inconsistency.
869 #: build/C/man2/init_module.2:213
871 "I<param_values> is invalid, or some part of the ELF image in I<module_image> "
872 "contains inconsistencies."
876 #: build/C/man2/init_module.2:213 build/C/man2/init_module.2:236
882 #: build/C/man2/init_module.2:219
884 "The binary image supplied in I<module_image> is not an ELF image, or is an "
885 "ELF image that is invalid or for a different architecture."
889 #: build/C/man2/init_module.2:222
890 msgid "The following errors may additionally occur for B<finit_module>():"
894 #: build/C/man2/init_module.2:222
900 #: build/C/man2/init_module.2:227
901 msgid "The file referred to by I<fd> is not opened for reading."
905 #: build/C/man2/init_module.2:227
911 #: build/C/man2/init_module.2:232
912 msgid "The file referred to by I<fd> is too large."
916 #: build/C/man2/init_module.2:236
917 msgid "I<flags> is invalid."
921 #: build/C/man2/init_module.2:240
922 msgid "I<fd> does not refer to an open file."
926 #: build/C/man2/init_module.2:252
928 "In addition to the above errors, if the module's I<init> function is "
929 "executed and returns an error, then B<init_module>() or B<finit_module>() "
930 "fails and I<errno> is set to the value returned by the I<init> function."
934 #: build/C/man2/init_module.2:255
935 msgid "B<finit_module ()> is available since Linux 3.8."
939 #: build/C/man2/init_module.2:260
940 msgid "B<init_module>() and B<finit_module>() are Linux-specific."
944 #: build/C/man2/init_module.2:263
946 "Glibc does not provide a wrapper for these system calls; call them using "
951 #: build/C/man2/init_module.2:268
953 "Information about currently loaded modules can be found in I</proc/modules> "
954 "and in the file trees under the per-module subdirectories under "
959 #: build/C/man2/init_module.2:272
961 "See the Linux kernel source file I<include/linux/module.h> for some useful "
962 "background information."
966 #: build/C/man2/init_module.2:277
968 "In Linux 2.4 and earlier, the B<init_module>() system call was rather "
973 #: build/C/man2/init_module.2:279
974 msgid "B<#include E<lt>linux/module.hE<gt>>"
978 #: build/C/man2/init_module.2:281
979 msgid "B< int init_module(const char *>I<name>B<, struct module *>I<image>B<);>"
983 #: build/C/man2/init_module.2:289
985 "(User-space applications can detect which version of B<init_module>() is "
986 "available by calling B<query_module>(); the latter call fails with the error "
987 "B<ENOSYS> on Linux 2.6 and later.)"
991 #: build/C/man2/init_module.2:300
993 "The older version of the system call loads the relocated module image "
994 "pointed to by I<image> into kernel space and runs the module's I<init> "
995 "function. The caller is responsible for providing the relocated image "
996 "(since Linux 2.6, the B<init_module>() system call does the relocation)."
1000 #: build/C/man2/init_module.2:304
1002 "The module image begins with a module structure and is followed by code and "
1003 "data as appropriate. Since Linux 2.2, the module structure is defined as "
1008 #: build/C/man2/init_module.2:327
1012 " unsigned long size_of_struct;\n"
1013 " struct module *next;\n"
1014 " const char *name;\n"
1015 " unsigned long size;\n"
1017 " unsigned long flags;\n"
1018 " unsigned int nsyms;\n"
1019 " unsigned int ndeps;\n"
1020 " struct module_symbol *syms;\n"
1021 " struct module_ref *deps;\n"
1022 " struct module_ref *refs;\n"
1023 " int (*init)(void);\n"
1024 " void (*cleanup)(void);\n"
1025 " const struct exception_table_entry *ex_table_start;\n"
1026 " const struct exception_table_entry *ex_table_end;\n"
1027 "#ifdef __alpha__\n"
1028 " unsigned long gp;\n"
1034 #: build/C/man2/init_module.2:337
1036 "All of the pointer fields, with the exception of I<next> and I<refs>, are "
1037 "expected to point within the module body and be initialized as appropriate "
1038 "for kernel space, that is, relocated with the rest of the module."
1042 #: build/C/man2/init_module.2:343
1044 "B<create_module>(2), B<delete_module>(2), B<query_module>(2), B<lsmod>(8), "
1049 #: build/C/man2/query_module.2:10
1051 msgid "QUERY_MODULE"
1055 #: build/C/man2/query_module.2:10
1061 #: build/C/man2/query_module.2:13
1062 msgid "query_module - query the kernel for various bits pertaining to modules"
1066 #: build/C/man2/query_module.2:19
1069 "B<int query_module(const char *>I<name>B<, int >I<which>B<, void "
1071 "B< size_t >I<bufsize>B<, size_t *>I<ret>B<);>\n"
1075 #: build/C/man2/query_module.2:43
1077 "B<query_module>() requests information from the kernel about loadable "
1078 "modules. The returned information is placed in the buffer pointed to by "
1079 "I<buf>. The caller must specify the size of I<buf> in I<bufsize>. The "
1080 "precise nature and format of the returned information depend on the "
1081 "operation specified by I<which>. Some operations require I<name> to "
1082 "identify a currently loaded module, some allow I<name> to be NULL, "
1083 "indicating the kernel proper."
1087 #: build/C/man2/query_module.2:46
1088 msgid "The following values can be specified for I<which>:"
1092 #: build/C/man2/query_module.2:46
1098 #: build/C/man2/query_module.2:51
1100 "Returns success, if the kernel supports B<query_module>(). Used to probe "
1101 "for availability of the system call."
1105 #: build/C/man2/query_module.2:51
1107 msgid "B<QM_MODULES>"
1110 #. ret is set on ENOSPC
1112 #: build/C/man2/query_module.2:59
1114 "Returns the names of all loaded modules. The returned buffer consists of a "
1115 "sequence of null-terminated strings; I<ret> is set to the number of modules."
1119 #: build/C/man2/query_module.2:59
1124 #. ret is set on ENOSPC
1126 #: build/C/man2/query_module.2:66
1128 "Returns the names of all modules used by the indicated module. The returned "
1129 "buffer consists of a sequence of null-terminated strings; I<ret> is set to "
1130 "the number of modules."
1134 #: build/C/man2/query_module.2:66
1139 #. ret is set on ENOSPC
1141 #: build/C/man2/query_module.2:75
1143 "Returns the names of all modules using the indicated module. This is the "
1144 "inverse of B<QM_DEPS>. The returned buffer consists of a sequence of "
1145 "null-terminated strings; I<ret> is set to the number of modules."
1149 #: build/C/man2/query_module.2:75
1151 msgid "B<QM_SYMBOLS>"
1154 #. ret is set on ENOSPC
1156 #: build/C/man2/query_module.2:81
1158 "Returns the symbols and values exported by the kernel or the indicated "
1159 "module. The returned buffer is an array of structures of the following form"
1163 #: build/C/man2/query_module.2:88
1166 "struct module_symbol {\n"
1167 " unsigned long value;\n"
1168 " unsigned long name;\n"
1173 #: build/C/man2/query_module.2:98
1175 "followed by null-terminated strings. The value of I<name> is the character "
1176 "offset of the string relative to the start of I<buf>; I<ret> is set to the "
1177 "number of symbols."
1181 #: build/C/man2/query_module.2:98
1187 #: build/C/man2/query_module.2:102
1189 "Returns miscellaneous information about the indicated module. The output "
1194 #: build/C/man2/query_module.2:110
1197 "struct module_info {\n"
1198 " unsigned long address;\n"
1199 " unsigned long size;\n"
1200 " unsigned long flags;\n"
1205 #: build/C/man2/query_module.2:129
1207 "where I<address> is the kernel address at which the module resides, I<size> "
1208 "is the size of the module in bytes, and I<flags> is a mask of "
1209 "B<MOD_RUNNING>, B<MOD_AUTOCLEAN>, etc., that indicates the current status of "
1210 "the module (see the Linux kernel source file I<include/linux/module.h>). "
1211 "I<ret> is set to the size of the I<module_info> structure."
1215 #: build/C/man2/query_module.2:143
1217 "At least one of I<name>, I<buf>, or I<ret> was outside the program's "
1218 "accessible address space."
1221 #. Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
1223 #: build/C/man2/query_module.2:153
1225 "Invalid I<which>; or I<name> is NULL (indicating \"the kernel\"), but this "
1226 "is not permitted with the specified value of I<which>."
1230 #: build/C/man2/query_module.2:158
1231 msgid "No module by that I<name> exists."
1235 #: build/C/man2/query_module.2:158
1241 #: build/C/man2/query_module.2:163
1243 "The buffer size provided was too small. I<ret> is set to the minimum size "
1248 #: build/C/man2/query_module.2:168
1250 "B<query_module>() is not supported in this version of the kernel (e.g., the "
1251 "kernel is version 2.6 or later)."
1255 #: build/C/man2/query_module.2:175
1256 msgid "B<query_module>() is Linux-specific."
1260 #: build/C/man2/query_module.2:183
1262 "Some of the information that was formerly available via B<query_module>() "
1263 "can be obtained from I</proc/modules>, I</proc/kallsyms>, and the files "
1264 "under the directory I</sys/module>."
1268 #: build/C/man2/query_module.2:187
1270 "Glibc does not provide a wrapper for this system call; in the unlikely event "
1271 "that you need to use it on an old kernel, use B<syscall>(2)."
1275 #: build/C/man2/query_module.2:194
1277 "B<create_module>(2), B<delete_module>(2), B<get_kernel_syms>(2), "
1278 "B<init_module>(2), B<lsmod>(8), B<modinfo>(8)"