Query: mod_install
OS: osx
Section: 9f
Links: osx man pages all man pages
Forums: forum home forum categories
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
mod_install(9F) Kernel Functions for Drivers mod_install(9F)NAMEmod_install, mod_remove, mod_info - add, remove or query a loadable moduleSYNOPSIS#include <sys/modctl.h> int mod_install(struct modlinkage *modlinkage); int mod_remove(struct modlinkage *modlinkage); int mod_info(struct modlinkage *modlinkage, struct modinfo *modinfo);INTERFACE LEVELSolaris DDI specific (Solaris DDI).PARAMETERSmodlinkage Pointer to the loadable module's modlinkage structure which describes what type(s) of module elements are included in this loadable module. modinfo Pointer to the modinfo structure passed to _info(9E).DESCRIPTIONmod_install() must be called from a module's _init(9E) routine. mod_remove() must be called from a module's _fini(9E) routine. mod_info() must be called from a module's _info(9E) routine. When _init(9E) is executing, its call to mod_install() enables other threads to call attach(9E) even prior to mod_install() returning and _init(9E) completion. From a programming standpoint this means that all _init(9E) initialization must occur prior to _init(9E) calling mod_install(). If mod_install() fails (non-zero return value), any initialization must be undone. When _fini(9E) is executing, another thread may call attach(9E) prior to _fini(9E) calling mod_remove(). If this occurs, the mod_remove() fails (non-zero return). From a programming standpoint, this means that _init(9E) initilizations should only be undone after a successful return from mod_remove().RETURN VALUESmod_install() and mod_remove() return 0 upon success and non-zero on failure. mod_info() returns a non-zero value on success and 0 upon failure.EXAMPLESSee _init(9E) for an example that uses these functions.SEE ALSO_fini(9E), _info(9E), _init(9E), modldrv(9S), modlinkage(9S), modlstrmod(9S) Writing Device Drivers SunOS 5.10 12 May 2004 mod_install(9F)