Searched defs:cwd (Results 1 - 25 of 37) sorted by relevance

12

/illumos-gate/usr/src/cmd/svr4pkg/libinst/
H A Dflex_dev.c48 char *cwd = NULL; local
59 if ((cwd = getcwd(NULL, PATH_MAX)) == NULL) {
65 if (chdir(cwd) == -1) {
66 progerr(gettext(ERR_CHDIR), cwd, errno); local
67 (void) free(cwd);
71 (void) sprintf(new_device_name, "%s/%s", cwd, np);
76 (void) free(cwd);
85 (void) free(cwd);
/illumos-gate/usr/src/lib/libast/common/path/
H A Dpathaccess.c42 char cwd[PATH_MAX]; local
52 dirs = getcwd(cwd, sizeof(cwd));
/illumos-gate/usr/src/lib/libc/port/gen/
H A Drealpath.c50 char cwd[PATH_MAX]; local
78 * resulting embedded ".." components with trailing cwd components.
81 if (getcwd(cwd, sizeof (cwd)) == NULL) {
88 char *endcwd = cwd + strlen(cwd);
92 * left-to-right, components from cwd right-to-left.
108 if (endcwd + len >= cwd + PATH_MAX) {
118 (void) strcpy(resolved_name, cwd);
/illumos-gate/usr/src/cmd/ptools/pwdx/
H A Dpwdx.c41 char cwd[MAXPATHLEN], proc[128]; local
52 (void) snprintf(proc, sizeof (proc), "/proc/%d/path/cwd",
55 if ((ret = readlink(proc, cwd, sizeof (cwd) - 1)) <= 0) {
56 (void) fprintf(stderr, "%s: cannot resolve cwd for %s: %s\n",
61 cwd[ret] = '\0';
63 (void) printf("%d:\t%s\n", (int)p.pr_pid, cwd);
/illumos-gate/usr/src/lib/libproc/common/
H A DPexecname.c49 * Once we've computed a cwd and a relative path, we use try_exec() to
54 try_exec(struct ps_prochandle *P, const char *cwd, const char *path, char *buf, argument
60 (void) snprintf(buf, PATH_MAX, "%s/%s", cwd, path);
86 char cwd[PATH_MAX * 2]; local
103 * interpreted as the directory to use as an alternate cwd for
116 * At this point 'aout' is either "." or an alternate cwd. We use
120 if (realpath(aout, cwd) == NULL)
121 (void) strcpy(cwd, ".");
127 * basename appended to our cwd. If that also fails, and the process
128 * is in a zone, try again with the zone path instead of our cwd
[all...]
/illumos-gate/usr/src/cmd/mailx/
H A Dmain.c82 char *cwd, *mf; local
253 cwd = getcwd(NOSTR, PATHSIZE);
397 if (cwd == NOSTR)
398 cwd = getcwd(NOSTR, PATHSIZE);
399 nstrcat(cwd, PATHSIZE, "/");
400 nstrcat(cwd, PATHSIZE, ef);
401 ef = cwd;
H A Dcmd3.c238 char cwd[PATHSIZE], file[PATHSIZE]; local
249 if (getcwd(cwd, (int)sizeof (cwd)) == 0) {
251 gettext("Can't get current directory: %s\n"), cwd);
263 snprintf(file, sizeof (file), "%s/%s", cwd, editfile);
268 snprintf(file, sizeof (file), "%s/%s", cwd, mailname);
/illumos-gate/usr/src/cmd/sh/
H A Dpwd.c64 cwd(unsigned char *dir) function
/illumos-gate/usr/src/lib/libtecla/common/
H A Dhomedir.c453 char *cwd = getcwd(home->buffer, home->buflen); local
456 * This will differ from cwd in that it won't have had symbolic links
461 * If PWD was set, and it points to the same directory as cwd, return
467 if(pwd && cwd && stat(cwd, &cwdstat)==0 && stat(pwd, &pwdstat)==0 &&
474 if(!cwd)
477 * In the absence of a valid PWD, return cwd.
479 return cwd;
/illumos-gate/usr/src/uts/common/syscall/
H A Dchdir.c168 refstr_t *cwd; local
217 /* update abs cwd/root path see c2/audit.c */
224 * changing to the same directory. We set the cwd to NULL so that we
232 if ((cwd = PTOU(pp)->u_cwd) != NULL && newcwd)
236 if (cwd && newcwd)
237 refstr_rele(cwd);
/illumos-gate/usr/src/lib/libadm/common/
H A Dfulldevnm.c110 char cwd[MAXPATHLEN]; local
118 if (getcwd(cwd, sizeof (cwd)) == NULL)
126 /* strip the last directory component from cwd */
127 c = strrchr(cwd, '/');
137 len = strlen(cwd) + strlen(path) + 2;
141 (void) strcpy(wa, cwd);
/illumos-gate/usr/src/lib/libtsol/common/
H A Dsetflabel.c85 static char cwd[MAXPATHLEN]; local
95 if (*path != '/' && cwd[0] == '\0') {
96 if (getcwd(cwd, MAXPATHLEN) == NULL) {
97 cwd[0] = '\0';
105 if (abspath(cwd, path, canon) < 0)
/illumos-gate/usr/src/cmd/mdb/common/modules/genunix/
H A Dcombined.c58 combined_walk_data_t *cwd; local
60 cwd = mdb_alloc(sizeof (combined_walk_data_t), UM_SLEEP);
62 cwd->cwd_initial_walk_addr = wsp->walk_addr;
63 cwd->cwd_current_walk = cwd->cwd_final_walk = NULL;
64 cwd->cwd_next = cwd->cwd_prev = NULL;
65 cwd->cwd_tag = NULL;
66 wsp->walk_data = cwd;
82 combined_walk_data_save(combined_walk_data_t *cwd, voi argument
94 combined_walk_data_drop(combined_walk_data_t *cwd) argument
111 combined_walk_data_t *cwd; local
127 combined_walk_append(combined_walk_data_t *cwd, combined_walk_t *cw) argument
138 combined_walk_remove_current(combined_walk_data_t *cwd) argument
158 combined_walk_data_t *cwd = wsp->walk_data; local
176 combined_walk_data_t *cwd = wsp->walk_data; local
220 combined_walk_data_t *cwd; local
[all...]
/illumos-gate/usr/src/cmd/cron/
H A Dfuncs.c239 char *cwd = getcwd(NULL, 0); local
244 if (cwd != NULL) {
245 (void) chdir(cwd);
/illumos-gate/usr/src/lib/mpss/common/
H A Dmpss.c221 fnmatch(const char *execname, char *cfgname, char *cwd) argument
233 ename = (const char *)strcat(cwd, execname);
306 char *cwd; local
379 cwd = getcwd(pbuf, MAXPATHLEN);
380 if (!cwd)
383 cwd = strcat(cwd, "/");
384 cwdlen = strlen(cwd);
434 if (!fnmatch(execname, tok, cwd)) {
436 cwd[cwdle
[all...]
/illumos-gate/usr/src/lib/libtnfctl/
H A Dutil.c447 char *cwd; local
450 cwd = getcwd(NULL, MAXPATHLEN);
451 if (!cwd) {
454 if ((strlen(cwd) + 1 + strlen(trace_file_name) + 1) >
459 (void) sprintf(path, "%s/%s", cwd, trace_file_name);
461 free(cwd);
/illumos-gate/usr/src/lib/libpkg/common/
H A Dverify.c400 char cwd[MAXPATHLEN]; local
422 if (getcwd(cwd, MAXPATHLEN) == NULL) {
456 (void) chdir(cwd);
466 (void) chdir(cwd);
474 if (chdir(cwd) != 0)
475 reperr(pkg_gt(ERR_CHDIR), cwd); local
483 if (chdir(cwd) != 0) {
484 reperr(pkg_gt(ERR_CHDIR), cwd); local
H A Dpkgtrans.c935 char cwd[MAXPATHLEN + 1]; local
1125 /* save cwd and change to symlink dir for cpio invocation */
1126 if (getcwd(cwd, MAXPATHLEN + 1) == NULL) {
1156 if (chdir(cwd)) {
1158 logerr(pkg_gt(MSG_CHDIR), cwd); local
1868 char cwd[MAXPATHLEN + 1]; local
1878 if (getcwd(cwd, MAXPATHLEN + 1) == NULL) {
1908 if (chdir(cwd)) {
1910 logerr(pkg_gt(MSG_CHDIR), cwd); local
/illumos-gate/usr/src/cmd/fstyp/
H A Dfstyp.c220 char *cwd; local
227 cwd = getcwd(NULL, size);
228 if ((path == NULL) || (rpath == NULL) || (cwd == NULL)) {
236 (void) snprintf(path, size, "%s/%s", cwd, execname);
247 if (cwd != NULL) {
248 free(cwd);
/illumos-gate/usr/src/uts/common/os/
H A Dexit.c345 refstr_t *cwd; local
769 cwd = PTOU(p)->u_cwd;
870 if (cwd)
871 refstr_rele(cwd);
/illumos-gate/usr/src/lib/madv/common/
H A Dmadv.c217 fnmatch(const char *execname, char *cfgname, char *cwd) argument
229 ename = (const char *)strcat(cwd, execname);
442 char *cwd; local
502 cwd = getcwd(pbuf, MAXPATHLEN);
503 if (!cwd)
506 cwd = strcat(cwd, "/");
507 cwdlen = strlen(cwd);
557 if (!fnmatch(execname, tok, cwd)) {
559 cwd[cwdle
[all...]
/illumos-gate/usr/src/uts/common/fs/
H A Dlookup.c787 * are currently in '/proc/self/fd', then '/proc/self/cwd' will compare
1294 * which is the behavior of {cwd/root}. Trying to resolve this path
1295 * will result in /proc/pid/cwd instead of whatever the real working
1469 refstr_t *cwd, *oldcwd; local
1475 * Check to see if there is a cached version of the cwd. If so, lookup
1479 if ((cwd = PTOU(p)->u_cwd) != NULL)
1480 refstr_hold(cwd);
1489 if (cwd != NULL)
1490 refstr_rele(cwd);
1495 if (cwd) {
[all...]
/illumos-gate/usr/src/cmd/isns/isnsd/xml/
H A Ddata.c790 char *cwd = NULL; local
826 cwd = getcwd(NULL, MAXPATHLEN);
827 if (cwd == NULL) {
842 (void) chdir(cwd);
843 free(cwd);
/illumos-gate/usr/src/cmd/chmod/
H A Dchmod.c970 rest_cwd(int cwd) argument
972 if (cwd != -1) {
973 if (fchdir(cwd) != 0) {
977 (void) close(cwd);
1076 int cwd; local
1111 if ((cwd = save_cwd()) < 0) {
1119 (void) close(cwd);
1145 rest_cwd(cwd);
/illumos-gate/usr/src/cmd/fs.d/ufs/df/
H A Ddf.c770 static char cwd[MAXPATHLEN]; local
781 if (*path != '/' && cwd[0] == '\0') {
782 if (getcwd(cwd, MAXPATHLEN) == NULL) {
783 cwd[0] = '\0';
798 if (abspath(cwd, path, scratch) < 0)

Completed in 110 milliseconds

12