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: 2015-01-23 22:24+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=UTF-8\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/delete_module.2:25 build/C/man2/init_module.2:27 build/C/man2/query_module.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:22 build/C/man2/delete_module.2:35 build/C/man2/query_module.2:23
75 "I<Note>: No declaration of this function is provided in glibc headers; see "
80 #: build/C/man2/create_module.2:22 build/C/man2/delete_module.2:35 build/C/man2/get_kernel_syms.2:19 build/C/man2/init_module.2:45 build/C/man2/query_module.2:23
86 #: build/C/man2/create_module.2:25 build/C/man2/query_module.2:26
87 msgid "I<Note>: This system call is present only in kernels before Linux 2.6."
91 #: build/C/man2/create_module.2:30
93 "B<create_module>() attempts to create a loadable module entry and reserve "
94 "the kernel memory that will be needed to hold the module. This system call "
99 #: build/C/man2/create_module.2:30 build/C/man2/delete_module.2:124 build/C/man2/get_kernel_syms.2:48 build/C/man2/init_module.2:154 build/C/man2/query_module.2:129
105 #: build/C/man2/create_module.2:35
107 "On success, returns the kernel address at which the module will reside. On "
108 "error, -1 is returned and I<errno> is set appropriately."
112 #: build/C/man2/create_module.2:35 build/C/man2/delete_module.2:129 build/C/man2/get_kernel_syms.2:54 build/C/man2/init_module.2:159 build/C/man2/query_module.2:134
118 #: build/C/man2/create_module.2:36 build/C/man2/init_module.2:198
124 #: build/C/man2/create_module.2:39
125 msgid "A module by that name already exists."
129 #: build/C/man2/create_module.2:39 build/C/man2/delete_module.2:143 build/C/man2/init_module.2:166 build/C/man2/query_module.2:135
135 #: build/C/man2/create_module.2:43
136 msgid "I<name> is outside the program's accessible address space."
140 #: build/C/man2/create_module.2:43 build/C/man2/init_module.2:201 build/C/man2/init_module.2:236 build/C/man2/query_module.2:143
146 #: build/C/man2/create_module.2:46
147 msgid "The requested size is too small even for the module header information."
151 #: build/C/man2/create_module.2:46 build/C/man2/init_module.2:181
157 #: build/C/man2/create_module.2:50
159 "The kernel could not allocate a contiguous block of memory large enough for "
164 #: build/C/man2/create_module.2:50 build/C/man2/get_kernel_syms.2:56 build/C/man2/query_module.2:163
170 #: build/C/man2/create_module.2:55
172 "B<create_module>() is not supported in this version of the kernel (e.g., "
173 "the kernel is version 2.6 or later)."
177 #: build/C/man2/create_module.2:55 build/C/man2/delete_module.2:150 build/C/man2/init_module.2:184
183 #: build/C/man2/create_module.2:61
185 "The caller was not privileged (did not have the B<CAP_SYS_MODULE> "
190 #: build/C/man2/create_module.2:61 build/C/man2/get_kernel_syms.2:60 build/C/man2/init_module.2:256 build/C/man2/query_module.2:168
195 #. Removed in Linux 2.5.48
197 #: build/C/man2/create_module.2:65 build/C/man2/get_kernel_syms.2:64 build/C/man2/query_module.2:172
199 "This system call is present on Linux only up until kernel 2.4; it was "
200 "removed in Linux 2.6."
204 #: build/C/man2/create_module.2:65 build/C/man2/delete_module.2:172 build/C/man2/get_kernel_syms.2:64 build/C/man2/init_module.2:259 build/C/man2/query_module.2:172
206 msgid "CONFORMING TO"
210 #: build/C/man2/create_module.2:68
211 msgid "B<create_module>() is Linux-specific."
215 #: build/C/man2/create_module.2:68 build/C/man2/delete_module.2:175 build/C/man2/init_module.2:264 build/C/man2/query_module.2:175
221 #: build/C/man2/create_module.2:78
223 "The B<create_module>() system call is not supported by glibc. No "
224 "declaration is provided in glibc headers, but, through a quirk of history, "
225 "glibc does export an ABI for this system call. Therefore, in order to "
226 "employ this system call, it is sufficient to manually declare the interface "
227 "in your code; alternatively, you can invoke the system call using "
232 #: build/C/man2/create_module.2:78 build/C/man2/delete_module.2:209 build/C/man2/get_kernel_syms.2:80 build/C/man2/init_module.2:353 build/C/man2/query_module.2:193
238 #: build/C/man2/create_module.2:82
239 msgid "B<delete_module>(2), B<init_module>(2), B<query_module>(2)"
243 #: build/C/man2/create_module.2:82 build/C/man2/delete_module.2:216 build/C/man2/get_kernel_syms.2:85 build/C/man2/init_module.2:359 build/C/man2/query_module.2:200
249 #: build/C/man2/create_module.2:90 build/C/man2/delete_module.2:224 build/C/man2/get_kernel_syms.2:93 build/C/man2/init_module.2:367 build/C/man2/query_module.2:208
251 "This page is part of release 3.78 of the Linux I<man-pages> project. A "
252 "description of the project, information about reporting bugs, and the latest "
253 "version of this page, can be found at "
254 "\\%http://www.kernel.org/doc/man-pages/."
258 #: build/C/man2/delete_module.2:25
260 msgid "DELETE_MODULE"
264 #: build/C/man2/delete_module.2:28
265 msgid "delete_module - unload a kernel module"
269 #: build/C/man2/delete_module.2:31
271 msgid "B<int delete_module(const char *>I<name>B<, int >I<flags>B<);>\n"
275 #: build/C/man2/delete_module.2:49
277 "The B<delete_module>() system call attempts to remove the unused loadable "
278 "module entry identified by I<name>. If the module has an I<exit> function, "
279 "then that function is executed before unloading the module. The I<flags> "
280 "argument is used to modify the behavior of the system call, as described "
281 "below. This system call requires privilege."
285 #: build/C/man2/delete_module.2:51
286 msgid "Module removal is attempted according to the following rules:"
290 #: build/C/man2/delete_module.2:51
296 #: build/C/man2/delete_module.2:55
298 "If there are other loaded modules that depend on (i.e., refer to symbols "
299 "defined in) this module, then the call fails."
303 #: build/C/man2/delete_module.2:55
309 #: build/C/man2/delete_module.2:59
311 "Otherwise, if the reference count for the module (i.e., the number of "
312 "processes currently using the module) is zero, then the module is "
313 "immediately unloaded."
317 #: build/C/man2/delete_module.2:59
322 #. O_TRUNC == KMOD_REMOVE_FORCE in kmod library
323 #. O_NONBLOCK == KMOD_REMOVE_NOWAIT in kmod library
325 #: build/C/man2/delete_module.2:70
327 "If a module has a nonzero reference count, then the behavior depends on the "
328 "bits set in I<flags>. In normal usage (see NOTES), the B<O_NONBLOCK> flag "
329 "is always specified, and the B<O_TRUNC> flag may additionally be specified."
333 #: build/C/man2/delete_module.2:74
334 msgid "The various combinations for I<flags> have the following effect:"
338 #: build/C/man2/delete_module.2:75
340 msgid "B<flags == O_NONBLOCK>"
344 #: build/C/man2/delete_module.2:78
345 msgid "The call returns immediately, with an error."
349 #: build/C/man2/delete_module.2:78
351 msgid "B<flags == (O_NONBLOCK | O_TRUNC)>"
355 #: build/C/man2/delete_module.2:82
357 "The module is unloaded immediately, regardless of whether it has a nonzero "
362 #: build/C/man2/delete_module.2:82
364 msgid "B<(flags & O_NONBLOCK) == 0>"
368 #: build/C/man2/delete_module.2:89
369 msgid "If I<flags> does not specify B<O_NONBLOCK>, the following steps occur:"
373 #: build/C/man2/delete_module.2:90 build/C/man2/delete_module.2:92 build/C/man2/delete_module.2:97
379 #: build/C/man2/delete_module.2:92
380 msgid "The module is marked so that no new references are permitted."
384 #: build/C/man2/delete_module.2:97
386 "If the module's reference count is nonzero, the caller is placed in an "
387 "uninterruptible sleep state (B<TASK_UNINTERRUPTIBLE>) until the reference "
388 "count is zero, at which point the call unblocks."
392 #: build/C/man2/delete_module.2:99
393 msgid "The module is unloaded in the usual way."
397 #: build/C/man2/delete_module.2:113
399 "The B<O_TRUNC> flag has one further effect on the rules described above. By "
400 "default, if a module has an I<init> function but no I<exit> function, then "
401 "an attempt to remove the module will fail. However, if B<O_TRUNC> was "
402 "specified, this requirement is bypassed."
406 #: build/C/man2/delete_module.2:124
408 "Using the B<O_TRUNC> flag is dangerous! If the kernel was not built with "
409 "B<CONFIG_MODULE_FORCE_UNLOAD>, this flag is silently ignored. (Normally, "
410 "B<CONFIG_MODULE_FORCE_UNLOAD> is enabled.) Using this flag taints the "
411 "kernel (TAINT_FORCED_RMMOD)."
415 #: build/C/man2/delete_module.2:129 build/C/man2/query_module.2:134
417 "On success, zero is returned. On error, -1 is returned and I<errno> is set "
422 #: build/C/man2/delete_module.2:130 build/C/man2/init_module.2:163
428 #: build/C/man2/delete_module.2:143
430 "The module is not \"live\" (i.e., it is still being initialized or is "
431 "already marked for removal); or, the module has an I<init> function but has "
432 "no I<exit> function, and B<O_TRUNC> was not specified in I<flags>."
436 #: build/C/man2/delete_module.2:147
437 msgid "I<name> refers to a location outside the process's accessible address space."
441 #: build/C/man2/delete_module.2:147 build/C/man2/query_module.2:153
447 #: build/C/man2/delete_module.2:150
448 msgid "No module by that name exists."
452 #: build/C/man2/delete_module.2:161
454 "The caller was not privileged (did not have the B<CAP_SYS_MODULE> "
455 "capability), or module unloading is disabled (see "
456 "I</proc/sys/kernel/modules_disabled> in B<proc>(5))."
460 #: build/C/man2/delete_module.2:161
462 msgid "B<EWOULDBLOCK>"
466 #: build/C/man2/delete_module.2:172
468 "Other modules depend on this module; or, B<O_NONBLOCK> was specified in "
469 "I<flags>, but the reference count of this module is nonzero and B<O_TRUNC> "
470 "was not specified in I<flags>."
474 #: build/C/man2/delete_module.2:175
475 msgid "B<delete_module>() is Linux-specific."
479 #: build/C/man2/delete_module.2:185
481 "The B<delete_module>() system call is not supported by glibc. No "
482 "declaration is provided in glibc headers, but, through a quirk of history, "
483 "glibc does export an ABI for this system call. Therefore, in order to "
484 "employ this system call, it is sufficient to manually declare the interface "
485 "in your code; alternatively, you can invoke the system call using "
490 #: build/C/man2/delete_module.2:195
492 "The uninterruptible sleep that may occur if B<O_NONBLOCK> is omitted from "
493 "I<flags> is considered undesirable, because the sleeping process is left in "
494 "an unkillable state. As at Linux 3.7, specifying B<O_NONBLOCK> is optional, "
495 "but in future kernels it is likely to become mandatory."
499 #: build/C/man2/delete_module.2:195 build/C/man2/init_module.2:288
501 msgid "Linux 2.4 and earlier"
505 #: build/C/man2/delete_module.2:197
506 msgid "In Linux 2.4 and earlier, the system call took only one argument:"
510 #: build/C/man2/delete_module.2:199
511 msgid "B< int delete_module(const char *>I<name>B<);>"
515 #: build/C/man2/delete_module.2:203
516 msgid "If I<name> is NULL, all unused modules marked auto-clean are removed."
520 #: build/C/man2/delete_module.2:209
522 "Some further details of differences in the behavior of B<delete_module>() "
523 "in Linux 2.4 and earlier are I<not> currently explained in this manual page."
527 #: build/C/man2/delete_module.2:216
529 "B<create_module>(2), B<init_module>(2), B<query_module>(2), B<lsmod>(8), "
530 "B<modprobe>(8), B<rmmod>(8)"
534 #: build/C/man2/get_kernel_syms.2:10
536 msgid "GET_KERNEL_SYMS"
540 #: build/C/man2/get_kernel_syms.2:10
546 #: build/C/man2/get_kernel_syms.2:13
547 msgid "get_kernel_syms - retrieve exported kernel and module symbols"
551 #: build/C/man2/get_kernel_syms.2:18
553 msgid "B<int get_kernel_syms(struct kernel_sym *>I<table>B<);>\n"
557 #: build/C/man2/get_kernel_syms.2:22
558 msgid "B<Note>: This system call is present only in kernels before Linux 2.6."
562 #: build/C/man2/get_kernel_syms.2:29
564 "If I<table> is NULL, B<get_kernel_syms>() returns the number of symbols "
565 "available for query. Otherwise, it fills in a table of structures:"
569 #: build/C/man2/get_kernel_syms.2:36
572 "struct kernel_sym {\n"
573 " unsigned long value;\n"
579 #: build/C/man2/get_kernel_syms.2:44
581 "The symbols are interspersed with magic symbols of the form "
582 "B<#>I<module-name> with the kernel having an empty name. The value "
583 "associated with a symbol of this form is the address at which the module is "
588 #: build/C/man2/get_kernel_syms.2:48
590 "The symbols exported from each module follow their magic module tag and the "
591 "modules are returned in the reverse of the order in which they were loaded."
595 #: build/C/man2/get_kernel_syms.2:54
597 "On success, returns the number of symbols copied to I<table>. On error, -1 "
598 "is returned and I<errno> is set appropriately."
602 #: build/C/man2/get_kernel_syms.2:56
603 msgid "There is only one possible error return:"
607 #: build/C/man2/get_kernel_syms.2:60
608 msgid "B<get_kernel_syms>() is not supported in this version of the kernel."
612 #: build/C/man2/get_kernel_syms.2:67
613 msgid "B<get_kernel_syms>() is Linux-specific."
617 #: build/C/man2/get_kernel_syms.2:67
623 #: build/C/man2/get_kernel_syms.2:72
625 "There is no way to indicate the size of the buffer allocated for I<table>. "
626 "If symbols have been added to the kernel since the program queried for the "
627 "symbol table size, memory will be corrupted."
631 #: build/C/man2/get_kernel_syms.2:74
632 msgid "The length of exported symbol names is limited to 59 characters."
636 #: build/C/man2/get_kernel_syms.2:80
638 "Because of these limitations, this system call is deprecated in favor of "
639 "B<query_module>(2) (which is itself nowadays deprecated in favor of other "
640 "interfaces described on its manual page)."
644 #: build/C/man2/get_kernel_syms.2:85
646 "B<create_module>(2), B<delete_module>(2), B<init_module>(2), "
651 #: build/C/man2/init_module.2:27
657 #: build/C/man2/init_module.2:30
658 msgid "init_module, finit_module - load a kernel module"
662 #: build/C/man2/init_module.2:34
665 "B<int init_module(void *>I<module_image>B<, unsigned long >I<len>B<,>\n"
666 "B< const char *>I<param_values>B<);>\n"
670 #: build/C/man2/init_module.2:37
673 "B<int finit_module(int >I<fd>B<, const char *>I<param_values>B<,>\n"
674 "B< int >I<flags>B<);>\n"
678 #: build/C/man2/init_module.2:45
680 "I<Note>: glibc provides no header file declaration of B<init_module>() and "
681 "no wrapper function for B<finit_module>(); see NOTES."
685 #: build/C/man2/init_module.2:54
687 "B<init_module>() loads an ELF image into kernel space, performs any "
688 "necessary symbol relocations, initializes module parameters to values "
689 "provided by the caller, and then runs the module's I<init> function. This "
690 "system call requires privilege."
694 #: build/C/man2/init_module.2:62
696 "The I<module_image> argument points to a buffer containing the binary image "
697 "to be loaded; I<len> specifies the size of that buffer. The module image "
698 "should be a valid ELF image, built for the running kernel."
702 #: build/C/man2/init_module.2:73
704 "The I<param_values> argument is a string containing space-delimited "
705 "specifications of the values for module parameters (defined inside the "
706 "module using B<module_param>() and B<module_param_array>()). The kernel "
707 "parses this string and initializes the specified parameters. Each of the "
708 "parameter specifications has the form:"
712 #: build/C/man2/init_module.2:78
713 msgid "I<name>[B<=>I<value>[B<,>I<value>...]]"
717 #: build/C/man2/init_module.2:93
719 "The parameter I<name> is one of those defined within the module using "
720 "I<module_param>() (see the Linux kernel source file "
721 "I<include/linux/moduleparam.h>). The parameter I<value> is optional in the "
722 "case of I<bool> and I<invbool> parameters. Values for array parameters are "
723 "specified as a comma-separated list."
727 #: build/C/man2/init_module.2:93
729 msgid "finit_module()"
732 #. commit 34e1169d996ab148490c01b65b4ee371cf8ffba2
733 #. https://lwn.net/Articles/519010/
735 #: build/C/man2/init_module.2:111
737 "The B<finit_module>() system call is like B<init_module>(), but reads the "
738 "module to be loaded from the file descriptor I<fd>. It is useful when the "
739 "authenticity of a kernel module can be determined from its location in the "
740 "filesystem; in cases where that is possible, the overhead of using "
741 "cryptographically signed modules to determine the authenticity of a module "
742 "can be avoided. The I<param_values> argument is as for B<init_module>()."
745 #. commit 2f3238aebedb243804f58d62d57244edec4149b2
747 #: build/C/man2/init_module.2:119
749 "The I<flags> argument modifies the operation of B<finit_module>(). It is a "
750 "bit mask value created by ORing together zero or more of the following "
755 #: build/C/man2/init_module.2:119
757 msgid "B<MODULE_INIT_IGNORE_MODVERSIONS>"
761 #: build/C/man2/init_module.2:122
762 msgid "Ignore symbol version hashes."
766 #: build/C/man2/init_module.2:122
768 msgid "B<MODULE_INIT_IGNORE_VERMAGIC>"
772 #: build/C/man2/init_module.2:125
773 msgid "Ignore kernel version magic."
776 #. http://www.tldp.org/HOWTO/Module-HOWTO/basekerncompat.html
777 #. is dated, but informative
779 #: build/C/man2/init_module.2:143
781 "There are some safety checks built into a module to ensure that it matches "
782 "the kernel against which it is loaded. These checks are recorded when the "
783 "module is built and verified when the module is loaded. First, the module "
784 "records a \"vermagic\" string containing the kernel version number and "
785 "prominent features (such as the CPU type). Second, if the module was built "
786 "with the B<CONFIG_MODVERSIONS> configuration option enabled, a version hash "
787 "is recorded for each symbol the module uses. This hash is based on the "
788 "types of the arguments and return value for the function named by the "
789 "symbol. In this case, the kernel version number within the \"vermagic\" "
790 "string is ignored, as the symbol version hashes are assumed to be "
791 "sufficiently reliable."
795 #: build/C/man2/init_module.2:154
797 "Using the B<MODULE_INIT_IGNORE_VERMAGIC> flag indicates that the "
798 "\"vermagic\" string is to be ignored, and the "
799 "B<MODULE_INIT_IGNORE_MODVERSIONS> flag indicates that the symbol version "
800 "hashes are to be ignored. If the kernel is built to permit forced loading "
801 "(i.e., configured with B<CONFIG_MODULE_FORCE_LOAD>), then loading will "
802 "continue, otherwise it will fail with B<ENOEXEC> as expected for malformed "
807 #: build/C/man2/init_module.2:159
809 "On success, these system calls return 0. On error, -1 is returned and "
810 "I<errno> is set appropriately."
814 #: build/C/man2/init_module.2:160
816 msgid "B<EBADMSG> (since Linux 3.7)"
820 #: build/C/man2/init_module.2:163
821 msgid "Module signature is misformatted."
825 #: build/C/man2/init_module.2:166
826 msgid "Timeout while trying to resolve a symbol reference by this module."
830 #: build/C/man2/init_module.2:170
832 "An address argument referred to a location that is outside the process's "
833 "accessible address space."
837 #: build/C/man2/init_module.2:170
839 msgid "B<ENOKEY> (since Linux 3.7)"
842 #. commit 48ba2462ace6072741fd8d0058207d630ce93bf1
843 #. commit 1d0059f3a468825b5fc5405c636a2f6e02707ffa
844 #. commit 106a4ee258d14818467829bf0e12aeae14c16cd7
846 #: build/C/man2/init_module.2:181
848 "Module signature is invalid or the kernel does not have a key for this "
849 "module. This error is returned only if the kernel was configured with "
850 "B<CONFIG_MODULE_SIG_FORCE>; if the kernel was not configured with this "
851 "option, then an invalid or unsigned module simply taints the kernel."
855 #: build/C/man2/init_module.2:184
856 msgid "Out of memory."
860 #: build/C/man2/init_module.2:195
862 "The caller was not privileged (did not have the B<CAP_SYS_MODULE> "
863 "capability), or module loading is disabled (see "
864 "I</proc/sys/kernel/modules_disabled> in B<proc>(5))."
868 #: build/C/man2/init_module.2:198
869 msgid "The following errors may additionally occur for B<init_module>():"
873 #: build/C/man2/init_module.2:201
874 msgid "A module with this name is already loaded."
878 #. .BR EINVAL " (Linux 2.4 and earlier)"
881 #. slot is filled in incorrectly,
883 #. does not correspond to the original module name, some
885 #. entry does not correspond to a loaded module,
886 #. or some other similar inconsistency.
888 #: build/C/man2/init_module.2:217
890 "I<param_values> is invalid, or some part of the ELF image in I<module_image> "
891 "contains inconsistencies."
895 #: build/C/man2/init_module.2:217 build/C/man2/init_module.2:240
901 #: build/C/man2/init_module.2:223
903 "The binary image supplied in I<module_image> is not an ELF image, or is an "
904 "ELF image that is invalid or for a different architecture."
908 #: build/C/man2/init_module.2:226
909 msgid "The following errors may additionally occur for B<finit_module>():"
913 #: build/C/man2/init_module.2:226
919 #: build/C/man2/init_module.2:231
920 msgid "The file referred to by I<fd> is not opened for reading."
924 #: build/C/man2/init_module.2:231
930 #: build/C/man2/init_module.2:236
931 msgid "The file referred to by I<fd> is too large."
935 #: build/C/man2/init_module.2:240
936 msgid "I<flags> is invalid."
940 #: build/C/man2/init_module.2:244
941 msgid "I<fd> does not refer to an open file."
945 #: build/C/man2/init_module.2:256
947 "In addition to the above errors, if the module's I<init> function is "
948 "executed and returns an error, then B<init_module>() or B<finit_module>() "
949 "fails and I<errno> is set to the value returned by the I<init> function."
953 #: build/C/man2/init_module.2:259
954 msgid "B<finit_module>() is available since Linux 3.8."
958 #: build/C/man2/init_module.2:264
959 msgid "B<init_module>() and B<finit_module>() are Linux-specific."
963 #: build/C/man2/init_module.2:274
965 "The B<init_module>() system call is not supported by glibc. No declaration "
966 "is provided in glibc headers, but, through a quirk of history, glibc does "
967 "export an ABI for this system call. Therefore, in order to employ this "
968 "system call, it is sufficient to manually declare the interface in your "
969 "code; alternatively, you can invoke the system call using B<syscall>(2)."
973 #: build/C/man2/init_module.2:279
975 "Glibc does not provide a wrapper for B<finit_module>(); call it using "
980 #: build/C/man2/init_module.2:284
982 "Information about currently loaded modules can be found in I</proc/modules> "
983 "and in the file trees under the per-module subdirectories under "
988 #: build/C/man2/init_module.2:288
990 "See the Linux kernel source file I<include/linux/module.h> for some useful "
991 "background information."
995 #: build/C/man2/init_module.2:293
997 "In Linux 2.4 and earlier, the B<init_module>() system call was rather "
1002 #: build/C/man2/init_module.2:295
1003 msgid "B<#include E<lt>linux/module.hE<gt>>"
1007 #: build/C/man2/init_module.2:297
1008 msgid "B< int init_module(const char *>I<name>B<, struct module *>I<image>B<);>"
1012 #: build/C/man2/init_module.2:305
1014 "(User-space applications can detect which version of B<init_module>() is "
1015 "available by calling B<query_module>(); the latter call fails with the error "
1016 "B<ENOSYS> on Linux 2.6 and later.)"
1020 #: build/C/man2/init_module.2:316
1022 "The older version of the system call loads the relocated module image "
1023 "pointed to by I<image> into kernel space and runs the module's I<init> "
1024 "function. The caller is responsible for providing the relocated image "
1025 "(since Linux 2.6, the B<init_module>() system call does the relocation)."
1029 #: build/C/man2/init_module.2:320
1031 "The module image begins with a module structure and is followed by code and "
1032 "data as appropriate. Since Linux 2.2, the module structure is defined as "
1037 #: build/C/man2/init_module.2:343
1041 " unsigned long size_of_struct;\n"
1042 " struct module *next;\n"
1043 " const char *name;\n"
1044 " unsigned long size;\n"
1046 " unsigned long flags;\n"
1047 " unsigned int nsyms;\n"
1048 " unsigned int ndeps;\n"
1049 " struct module_symbol *syms;\n"
1050 " struct module_ref *deps;\n"
1051 " struct module_ref *refs;\n"
1052 " int (*init)(void);\n"
1053 " void (*cleanup)(void);\n"
1054 " const struct exception_table_entry *ex_table_start;\n"
1055 " const struct exception_table_entry *ex_table_end;\n"
1056 "#ifdef __alpha__\n"
1057 " unsigned long gp;\n"
1063 #: build/C/man2/init_module.2:353
1065 "All of the pointer fields, with the exception of I<next> and I<refs>, are "
1066 "expected to point within the module body and be initialized as appropriate "
1067 "for kernel space, that is, relocated with the rest of the module."
1071 #: build/C/man2/init_module.2:359
1073 "B<create_module>(2), B<delete_module>(2), B<query_module>(2), B<lsmod>(8), "
1078 #: build/C/man2/query_module.2:10
1080 msgid "QUERY_MODULE"
1084 #: build/C/man2/query_module.2:13
1085 msgid "query_module - query the kernel for various bits pertaining to modules"
1089 #: build/C/man2/query_module.2:19
1092 "B<int query_module(const char *>I<name>B<, int >I<which>B<, void "
1094 "B< size_t >I<bufsize>B<, size_t *>I<ret>B<);>\n"
1098 #: build/C/man2/query_module.2:43
1100 "B<query_module>() requests information from the kernel about loadable "
1101 "modules. The returned information is placed in the buffer pointed to by "
1102 "I<buf>. The caller must specify the size of I<buf> in I<bufsize>. The "
1103 "precise nature and format of the returned information depend on the "
1104 "operation specified by I<which>. Some operations require I<name> to "
1105 "identify a currently loaded module, some allow I<name> to be NULL, "
1106 "indicating the kernel proper."
1110 #: build/C/man2/query_module.2:46
1111 msgid "The following values can be specified for I<which>:"
1115 #: build/C/man2/query_module.2:46
1121 #: build/C/man2/query_module.2:51
1123 "Returns success, if the kernel supports B<query_module>(). Used to probe "
1124 "for availability of the system call."
1128 #: build/C/man2/query_module.2:51
1130 msgid "B<QM_MODULES>"
1133 #. ret is set on ENOSPC
1135 #: build/C/man2/query_module.2:59
1137 "Returns the names of all loaded modules. The returned buffer consists of a "
1138 "sequence of null-terminated strings; I<ret> is set to the number of modules."
1142 #: build/C/man2/query_module.2:59
1147 #. ret is set on ENOSPC
1149 #: build/C/man2/query_module.2:66
1151 "Returns the names of all modules used by the indicated module. The returned "
1152 "buffer consists of a sequence of null-terminated strings; I<ret> is set to "
1153 "the number of modules."
1157 #: build/C/man2/query_module.2:66
1162 #. ret is set on ENOSPC
1164 #: build/C/man2/query_module.2:75
1166 "Returns the names of all modules using the indicated module. This is the "
1167 "inverse of B<QM_DEPS>. The returned buffer consists of a sequence of "
1168 "null-terminated strings; I<ret> is set to the number of modules."
1172 #: build/C/man2/query_module.2:75
1174 msgid "B<QM_SYMBOLS>"
1177 #. ret is set on ENOSPC
1179 #: build/C/man2/query_module.2:81
1181 "Returns the symbols and values exported by the kernel or the indicated "
1182 "module. The returned buffer is an array of structures of the following form"
1186 #: build/C/man2/query_module.2:88
1189 "struct module_symbol {\n"
1190 " unsigned long value;\n"
1191 " unsigned long name;\n"
1196 #: build/C/man2/query_module.2:98
1198 "followed by null-terminated strings. The value of I<name> is the character "
1199 "offset of the string relative to the start of I<buf>; I<ret> is set to the "
1200 "number of symbols."
1204 #: build/C/man2/query_module.2:98
1210 #: build/C/man2/query_module.2:102
1212 "Returns miscellaneous information about the indicated module. The output "
1217 #: build/C/man2/query_module.2:110
1220 "struct module_info {\n"
1221 " unsigned long address;\n"
1222 " unsigned long size;\n"
1223 " unsigned long flags;\n"
1228 #: build/C/man2/query_module.2:129
1230 "where I<address> is the kernel address at which the module resides, I<size> "
1231 "is the size of the module in bytes, and I<flags> is a mask of "
1232 "B<MOD_RUNNING>, B<MOD_AUTOCLEAN>, and so on, that indicates the current "
1233 "status of the module (see the Linux kernel source file "
1234 "I<include/linux/module.h>). I<ret> is set to the size of the I<module_info> "
1239 #: build/C/man2/query_module.2:143
1241 "At least one of I<name>, I<buf>, or I<ret> was outside the program's "
1242 "accessible address space."
1245 #. Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
1247 #: build/C/man2/query_module.2:153
1249 "Invalid I<which>; or I<name> is NULL (indicating \"the kernel\"), but this "
1250 "is not permitted with the specified value of I<which>."
1254 #: build/C/man2/query_module.2:158
1255 msgid "No module by that I<name> exists."
1259 #: build/C/man2/query_module.2:158
1265 #: build/C/man2/query_module.2:163
1267 "The buffer size provided was too small. I<ret> is set to the minimum size "
1272 #: build/C/man2/query_module.2:168
1274 "B<query_module>() is not supported in this version of the kernel (e.g., the "
1275 "kernel is version 2.6 or later)."
1279 #: build/C/man2/query_module.2:175
1280 msgid "B<query_module>() is Linux-specific."
1284 #: build/C/man2/query_module.2:183
1286 "Some of the information that was formerly available via B<query_module>() "
1287 "can be obtained from I</proc/modules>, I</proc/kallsyms>, and the files "
1288 "under the directory I</sys/module>."
1292 #: build/C/man2/query_module.2:193
1294 "The B<query_module>() system call is not supported by glibc. No "
1295 "declaration is provided in glibc headers, but, through a quirk of history, "
1296 "glibc does export an ABI for this system call. Therefore, in order to "
1297 "employ this system call, it is sufficient to manually declare the interface "
1298 "in your code; alternatively, you can invoke the system call using "
1303 #: build/C/man2/query_module.2:200
1305 "B<create_module>(2), B<delete_module>(2), B<get_kernel_syms>(2), "
1306 "B<init_module>(2), B<lsmod>(8), B<modinfo>(8)"