modpath.2 (2010 09)

m
modpath(2) modpath(2)
NAME
modpath - change global search path for dynamically loadable kernel modules
SYNOPSIS
#include <sys/mod.h>
int modpath(const char *
pathname );
DESCRIPTION
modpath allows processes with appropriate privilege to modify the global search path used to locate
object files for dynamically loadable kernel modules. The search path modifications take effect immedi-
ately and affect all subsequent loads for all users on the system.
pathname may be either a colon-separated list of absolute path names or NULL. If the former, these
path names represent directories which should be searched for all autoloads of loadable kernel modules
and for demand loads (see modload (2)) where the module is given by a simple file name. This list of
directories will be prepended to the existing list of directories and so will be searched before any direc-
tories given in previous calls to
modpath
and before the default location which is always searched last.
The directories do not have to exist on the system at the time modpath is called, or when a load actually
takes place. If pathname is equal to NULL, the global search path is set back to its initial default value,
/usr/conf/mod
.
Notes
modpath is currently implemented as a macro. Module search path is not persistent across boots.
Security Restrictions
modpath is restricted to superuser processes or privileged processes. A privileged process requires the
PRIV_DLKM privilege to execute the modpath system call.
See privileges (5) for more information about the
DLKM_PRIV privilege.
RETURN VALUE
On success,
modpath returns 0, otherwise it returns -1 and sets errno to indicate the error.
ERRORS
modpath fails if one or more of the following are true:
[EINVAL] The list of directories specified by pathname is malformed.
[ENOSYS] The Dynamically Loadable Kernel Module feature is not initialized.
[ENAMETOOLONG] pathname is more than
MAXPATHLEN characters long.
[EPERM] The caller is not a superuser process or a privileged process.
SEE ALSO
kcmodule(1M), modload(2), privileges(5).
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)