Man page - query_module(2)

Packages contains this manual

Available languages:

en fr ja ru ro zh_TW zh_CN

Manual

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