modpath(2) modpath(2)
NAME
modpath - change loadable kernel modules search path
SYNOPSIS
#include <sys/mod.h>
int modpath(const char *pathname);
DESCRIPTION
modpath allows processes with privilege P_LOADMOD to modify
the global search path used to locate object files for
loadable kernel modules on disk. The search path
modifications take effect immediately and affect all
subsequent loads and all users on the system. Affected loads
include all auto-loads performed by the kernel auto-load
mechanism and all demand-loads performed by modload(2) using a
module name.
pathname can specify a colon-separated list of absolute
pathnames, or an absolute pathname, or NULL.
If pathname specifies a pathname, the named directories:
will be searched prior to searching any directories
specified by previous calls to modpath
will be searched prior to searching the default loadable
modules search path, which is always searched and always
searched last
do not have to exist on the system at the time modpath
is called
do not have to exist on the system at the time the load
takes place
If pathname is equal to NULL, the loadable modules search path
is reset to its default value /etc/conf/mod.d.
Return Values
On success, modpath returns 0. On failure, modpath returns -1
and sets errno to identify the error.
Errors
In the following conditions, modpath fails and sets errno to:
Copyright 1994 Novell, Inc. Page 1
modpath(2) modpath(2)
EINVAL List of directories specified by pathname is
malformed.
EPERM The caller does not possess P_LOADMOD privileges.
ENAMETOOLONG
pathname is more than MAXPATHLEN characters long.
ENOSYS Unable to perform the requested operation because
the loadable modules functions are not configured
into the system.
REFERENCES
modadmin(1M), modload(2)
Copyright 1994 Novell, Inc. Page 2