modstat.2 (2010 09)

m
modstat(2) modstat(2)
NAME
modstat() - get information for a dynamically loaded kernel module
SYNOPSIS
#include <sys/mod.h>
int modstat(
int module_id ,
struct modstatus *stbuf ,
int get_next_module
);
DESCRIPTION
modstat() allows processes to get information for dynamically loaded kernel modules. For processes
with appropriate privilege, it fills in all the elements of the
modstatus structure, specified by stbuf ,
with the information available for the given module identifier module_id . For nonprivileged processes,
modstat() fills in all information except the address and size of the module object file sections in
memory (ms_base , ms_size, ms_bss, ms_bss_size ).
If the value of get_next_module is TRUE,
modstat() returns the information for the next module whose
identifier is greater than or equal to module_id . Any module_id associated with a registered module may
be queried by
modstat().
The
struct modstatus and struct modspecific_stat
definitions are:
struct modstatus {
int32_t ms_id; /* numeric id of module */
uint64_t ms_base; /* base address of module */
uint32_t ms_size; /* amount of memory of module
when loaded */
uint64_t ms_bss; /* base address of BSS */
uint32_t ms_bss_size; /* memory size of BSS */
int32_t ms_rev; /* version number */
char ms_path[MAXPATHLEN]; /* loaded module path */
time_t ms_unload_delay; /* unload delay */
int32_t ms_holdcnt; /* hold count */
int32_t ms_depcnt; /* dependent count */
struct modspecific_stat /* module type specific info */
ms_msinfo[MODMAXLINK];
int ms_reg;
char ms_version[MODMAXVERLEN]; /* Version string */
};
struct modspecific_stat {
char mss_linkinfo[MODMAXLINKINFOLEN]; /* informational */
int32_t mss_type; /* type of module */
int32_t mss_p0[2]; /* type specific info */
int32_t mss_p1[2]; /* type specific info */
}
Notes
modstat() is currently implemented as a macro.
Security Restrictions
For nonprivileged processes,
modstat() returns all module information except address and size of
module object file sections in memory. To retrieve all information of the module including the address
and size of the module object file sections in memory using modstat(), the process must be a superuser
process or a privileged process with PRIV_DLKM privilege.
See privileges (5) for more information about the
DLKM_PRIV privilege.
RETURN VALUE
modstat() returns one of the following values:
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)