Penguin
Blame: query_module(2)
EditPageHistoryDiffInfoLikePages
Annotated edit history of query_module(2) version 5, including all changes. View license author blame.
Rev Author # Line
1 perry 1 !!NAME
5 PerryLorier 2 query_module - query the kernel for various bits pertaining to modules.
1 perry 3
4 !!SYNOPSIS
5 PerryLorier 5 __#include <linux/module.h>__
6 __int query_module(const char *__''name''__, int__ ''which''__, void *__''buf''__, size_t__ ''bufsize''__, size_t *__''ret''__); __
1 perry 7 !!DESCRIPTION
5 PerryLorier 8 __query_module__ requests information related to loadable modules from the kernel. The precise nature of the information and its format depends on the ''which'' sub function. Some functions require ''name'' to name a currently loaded module, some allow ''name'' to be __NULL__ indicating the kernel proper.
1 perry 9
5 PerryLorier 10 !!VALUES OF WHICH
1 perry 11
5 PerryLorier 12 ;0: Always returns success. Used to probe for the system call.
13 ;QM_MODULES: Returns the names of all loaded modules. The output buffer format is adjacent null-terminated strings; ''ret'' is set to the number of modules.
14 ;QM_DEPS: Returns the names of all modules used by the indicated module. The output buffer format is adjacent null-terminated strings; ''ret'' is set to the number of modules.
15 ;QM_REFS: Returns the names of all modules using the indicated module. This is the inverse of __QM_DEPS__. The output buffer format is adjacent null-terminated strings; ''ret'' is set to the number of modules.
16 ;QM_SYMBOLS: Returns the symbols and values exported by the kernel or the indicated module. The buffer format is an array of:
1 perry 17
5 PerryLorier 18 struct module_symbol
19 {
20 unsigned long value;
21 unsigned long name;
22 };
23 ;:followed by null-terminated strings. The value of ''name'' is the character offset of the string relative to the start of ''buf''; ''ret'' is set to the number of symbols.
1 perry 24
5 PerryLorier 25 ;QM_INFO: Returns miscellaneous information about the indicated module. The output buffer format is:
1 perry 26
5 PerryLorier 27 struct module_info
28 {
29 unsigned long address;
30 unsigned long size;
31 unsigned long flags;
32 };
1 perry 33
5 PerryLorier 34 ;:where ''address'' is the kernel address at which the module resides, ''size'' is the size of the module in bytes, and ''flags'' is a mask of __MOD_RUNNING__, __MOD_AUTOCLEAN__, et al that indicates the current status of the module. ''ret'' is set to the size of the __module_info__ struct.
1 perry 35
36 !!RETURN VALUE
5 PerryLorier 37 On success, zero is returned. On error, -1 is returned and ''errno'' is set appropriately.
1 perry 38 !!ERRORS
5 PerryLorier 39 ;[ENOENT]: No module by that ''name'' exists.
40 ;[EINVAL]: Invalid ''which'', or ''name'' indicates the kernel for an inappropriate sub function.
41 ;[ENOSPC]: The buffer size provided was too small. ''ret'' is set to the minimum size needed.
42 ;[EFAULT]: At least one of ''name'', ''buf'', or ''ret'' was outside the program's accessible address space.
1 perry 43
44 !!SEE ALSO
5 PerryLorier 45 create_module(2), init_module(2), delete_module(2).
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 4 times)