Lines Matching defs:cwd
46 * Once we've computed a cwd and a relative path, we use try_exec() to
51 try_exec(struct ps_prochandle *P, const char *cwd, const char *path, char *buf,
57 (void) snprintf(buf, PATH_MAX, "%s/%s", cwd, path);
83 char cwd[PATH_MAX * 2];
100 * interpreted as the directory to use as an alternate cwd for
113 * At this point 'aout' is either "." or an alternate cwd. We use
117 if (realpath(aout, cwd) == NULL)
118 (void) strcpy(cwd, ".");
124 * basename appended to our cwd. If that also fails, and the process
125 * is in a zone, try again with the zone path instead of our cwd.
132 if (try_exec(P, cwd, path, buf, isexec, isdata))
136 try_exec(P, cwd, p, buf, isexec, isdata))
144 * try_exec() only combines its cwd and path arguments
168 if (try_exec(P, cwd, path, buf, isexec, isdata))
172 try_exec(P, cwd, p, buf, isexec, isdata))
184 if (try_exec(P, cwd, path, buf, isexec, isdata))
188 try_exec(P, cwd, p, buf, isexec, isdata))
196 if (Pgetenv(P, "PATH", cwd, sizeof (cwd)) != NULL) {
217 for (p = strtok_r(cwd, ":", &q); p != NULL;
267 char cwd[PATH_MAX];
299 "%s/%d/path/cwd", procfs_path, (int)P->pid);
301 if ((ret = readlink(proc_cwd, cwd, PATH_MAX - 1)) > 0)
302 cwd[ret] = '\0';
304 (void) Pfindexec(P, ret > 0 ? cwd : NULL,