modpath(S)
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(S)
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:
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(ADM),
modload(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005