query_module 2 .SH NAME query_module

中文man手册

目录

query_module

NAME
æ»è§
æè¿°
è¿åå¼
é误
è·

NAME

query_module - ååæ ¸æ¥è¯¢å模åæå³çå个ä½. /* æ¥è¯¢æå³çä½?? */

æ»è§

#include <linux/module.h>

int query_module(const char *name, int which,void *buf, size_t bufsize, size _t *ret);

æè¿°

query_module请æ±åå¯å载模åæå³çæ¥èªåæ¸çä¿¡æ¯.ä¿¡æ¯çç»è´çç¹æ§åæ¼å¼ä¾èµäº whichåæ°,ä¸äºå½æ°è¦æ±nameåæ°æ¥å½åå½å被åè½½çæ¨¡å.ä¸äºåè®¸åæ°name为null, ææåæ ¸æ¯æ£ç¡®ç.: whichçå¼ 0 Always returns success. Used to probe for the system call. 0 æ»æ¯è¿åæå,ç¨æ¥æ¢æµç³»ç»è°ç¨. /* åè§ insmod -p ååé¢æç«  */ 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 mod ules.
è¿åææå·²å è½½ç模åçåå.è¾åºç¼å²åºçæ ¼å¼æ¯é»è¿ç以nullç»æ¢çå- 符串;ret 被 设置为模åçæ°ç®. 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 t o the number of modules. è¿åææè¢«nameåæ°æå®ç模å使ç¨ç模åçåå.è¾åº ç¼ å²åºæ ¼å¼æ¯é»è¿ç以nullç»æ¢çå符串;ret被设置为模åçæ°ç®. 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-te rminated strings; ret is set to the number of modules.
è¿åæææ£ä½¿ç¨è¢«nameåæ°æå®ç模åçæ¨¡ååå.è¿åQM_DEPSæ¯ç¸åç.è¾åºç¼å² åº æ ¼å¼æ¯ä»¥é»è¿çnullç»æ¢çå符串;ret被设置为模åçæ°ç®. QM_SYMBOLS Returns the symbols and values exported by the kernel or t he indicated module. The buffer format is an array of:
struct module_symbol
{
unsigned long value;
unsigned long name;
};
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 t he number of symbols.
è¿åè¢«åæ¸ææå®æ¨¡å导åº(弿¾)ç符å·åå¼å¯¹.ç¼å²åºæ¼å¼æ¯ä¸ä¸ªä»¥nullç»æ- ¢ç ç»ææ°ç»,nameç弿¯ç¸å¯¹ç¼å²åºçå¼å§çå符串çå- 符åç§»;ret被设置为符å·çæ°ç®.

struct module_symbol
{
unsigned long value;
unsigned long value;
} QM_INFO Returns miscelaneous information about the indicated module. The output buffer format is:
struct module_info
{
unsigned long address;
unsigned long size;
unsigned long flags;
};
where address is the kernel address at which the module reside s, size is the size of the module in bytes, and flags is a mask of MOD_RUNNI NG, MOD_AUTOCLEAN, et al that indicates the current status of the module. re t is set to the size of the module_info struct.
è¿ååç§åæå®æ¨¡åç¸å³çåç§ä¿¡æ¯,è¾åºç¼å²åºçæ ¼å¼å¦ä¸:
struct module_info
{
unsigned long address;
unsigned long size;
unsigned long flags;
}
addressæ¯æ¨¡åå¨å核空é´ä¸é©»ççå°å,sizeæ¯æ¨¡å以å- è计æ°ç大å°,flagsæ¯MOD_R UNING,MOD_AUTOCLEANç- æç¤ºæ¨¡åå½åç¶æçæ å¿çæä½æç»æçæ©ç.ret被设置为mod ule_infoç»æç大å°.

è¿åå¼

æåæ¶æ»æ¯è¿å0,é误æ¯è¿å-1,å¨å±åéerrno被ç¸åºè®¾ç½®.

é误

ENOENT

被nameæå®ç模åä¸åå¨.

EINVAL

ENOSPC

æä¾çç¼å²åºå¤ªå°,ret被设置为éè¦çæå°å¤§å°.

EFAULT

name,bufæretä¸è³å°ä¸ä¸ªè¶åºäºç¨åºå¯è®¿é®çå°å空é´.

"é·å" <nsinit@263.net>

è·

æ¬é¡µé¢ä¸æçç±ä¸æ man æå页计åæä¾ã
䏿 man æå页计åï¼https://github.com/man-pages-zh/manpages-zh