mod_install(9f) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

mod_install(9f)

mod_install(9F)                Kernel Functions                mod_install(9F)

NAME
       mod_install, mod_remove, mod_info, mod_modname - add, remove or query a
       loadable module

SYNOPSIS
       #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);


       const char *mod_modname(struct modlinkage *modlinkage);

INTERFACE LEVEL
       Solaris DDI specific (Solaris DDI).

PARAMETERS
       modlinkage    Pointer  to  the  loadable  module's modlinkage structure
                     which describes what type(s) of module elements  are  in‐
                     cluded in this loadable module.


       modinfo       Pointer to the modinfo structure passed to _info(9E).


DESCRIPTION
       mod_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.


       mod_modname() can be called from any module 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_in‐
       stall(). If mod_install() fails (non-zero return value),  any  initial‐
       ization 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)  initializations should only be undone after a successful re‐
       turn from mod_remove().


       To query the name of a module, use mod_modname(). If the  module  is  a
       driver,  the  module name is the same as the driver name. This function
       can be used to avoid compiled-in knowledge of the module name,  and  is
       of  particular  use  when  _init(9E)  needs  to  call  a  function like
       kstat_create(9F).

RETURN VALUES
       mod_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.


       mod_modname() returns the name of the module. The returned name remains
       valid as long as the module remains loaded.

EXAMPLES
       See _init(9E) for an example that uses these functions.

SEE ALSO
       _fini(9E),  _info(9E),  _init(9E),  kstat_create(9F), modldrv(9S), mod‐
       linkage(9S), modlstrmod(9S)


       Writing Device Drivers in Oracle Solaris 11.4

Oracle Solaris 11.4               27 Nov 2017                  mod_install(9F)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3