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


moduload — unload a kernel module on demand


#include <sys/mod.h> int moduload(long module_id);


moduload allows processes with appropriate privilege to demand unload one or all unloadable modules from the running kernel. A module is considered unloadable if it is not currently in use, if no module depending on it is currently loaded, and if the module is not being loaded or unloaded from the kernel. If module_id is set to 0 (zero), moduload attempts to unload all unloadable modules, otherwise moduload attempts to unload the module specified by module_id.


moduload is currently implemented as a macro.

Security Restrictions

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

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


On success, moduload returns 0, otherwise it returns -1 and sets errno to indicate the error.


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


module_id does not correspond to any valid currently loaded kernel module.


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


There are outstanding references to the module, or modules that depend on this module are currently loaded, or profiling is enabled, or the module is in the process of being loaded or unloaded from the kernel.


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.