Lines Matching defs:path

46 /* queue structure for the module path broken down into components */
49 char *path;
53 /* the Management Information Base entries for the search path sysctl */
58 /* the sysctl value - the current module search path */
63 /* Top-level path management functions */
68 /* Low-level path management functions */
93 /* Get the current module search path */
97 char *path;
108 err(1, "getting path: sysctl(%s) - size only", pathctl);
109 if ((path = malloc(sz + 1)) == NULL) {
111 err(1, "allocating %lu bytes for the path",
114 if (sysctl(mib, miblen, path, &sz, NULL, 0) == -1)
115 err(1, "getting path: sysctl(%s)", pathctl);
116 modpath = path;
119 /* Set the module search path after changing it */
129 err(1, "building path string");
132 err(1, "setting path: sysctl(%s)", pathctl);
139 /* Add/insert a new component to the module search path */
141 addpath(struct pathhead *pathq, char *path, int force, int insert)
150 * If the path exists, use it; otherwise, take the user-specified
151 * path at face value - may be a removed directory.
153 if (realpath(path, pathbuf) == NULL)
154 strlcpy(pathbuf, path, sizeof(pathbuf));
163 if (!strcmp(pe->path, pathbuf))
168 errx(1, "already in the module search path: %s", pathbuf);
173 ((pe->path = strdup(pathbuf)) == NULL)) {
175 err(1, "allocating path component");
191 /* Remove a path component from the module search path */
193 rempath(struct pathhead *pathq, char *path, int force, int insert __unused)
200 if (realpath(path, pathbuf) == NULL)
201 strlcpy(pathbuf, path, sizeof(pathbuf));
210 if (!strcmp(pe->path, pathbuf))
215 errx(1, "not in module search path: %s", pathbuf);
223 /* Display the retrieved module search path */
231 err(1, "building path string");
237 /* Break a string down into path components, store them into a queue */
239 parsepath(struct pathhead *pathq, char *path, int uniq)
244 while ((p = strsep(&path, ";")) != NULL)
247 ((pe->path = strdup(p)) == NULL)) {
249 err(1, "allocating path element");
257 /* Recreate a path string from a components queue */
267 s, pe->path, (TAILQ_NEXT(pe, next) != NULL? ";": ""));
283 "usage:\tkldconfig [-dfimnUv] [-S sysctlname] [path ...]",
294 /* iterator over argv[] path components */
301 /* "-m" - merge into the existing path, do not replace it */
303 /* "-n" - do not actually set the new module path */
305 /* "-r" - print out the current search path */
307 /* "-U" - remove duplicate values from the path */
313 /* The original path */
315 /* The module search path broken down into components */
383 /* Retrieve and store the path from the sysctl value */
387 err(1, "saving the original search path");
391 * Break down the path into the components queue if:
402 /* Process the path arguments */