Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > M


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


modload — load kernel modules on demand


#include <sys/mod.h> int modload(char *pathname);


modload allows processes with appropriate privilege to demand-load a kernel module into the running kernel. The module must be of a supported type and must have been registered via kcmodule(1M) before it can be loaded.

The module to be loaded is specified by pathname. pathname may be either a module name or an absolute path name. If pathname is a module name, a list of directories specified by modpath is searched for a match. If pathname is absolute, only pathname is used to access the object file. The file must be an ELF64 relocatable object file.


modload is currently implemented as a macro.

Security Restrictions

modload is restricted to superuser processes and privileged processes. A privileged process requires the PRIV_DLKM privilege to execute the modload system call.

See privileges(5), for more information about the DLKM_PRIV privilege.


On successful completion, modload returns a module identifier that can be passed to moduload or modstat. On failure it returns -1 and sets errno to identify the error.


modload fails if one or more of the following are true:


A component of pathname denies search permission.


The file named by pathname does not exist.


The module being loaded is not currently registered.


The file named by pathname is not appropriately pre-configured or has invalid dependency on other modules.


The caller is not a superuser process or a privileged process.


A relocation error occurred during the attempt to load the module, or the module references symbols not defined in the running kernel, or the module references symbols in another loadable module but it did not declare its dependence on this module in its module metadata.


pathname is more than MAXPATHLEN characters long.


The module wrapper has an incorrect version number.


The Dynamically Loadable Kernel Module feature is not initialized.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.