1 /* pwdx.c - report current directory of a process.
3 * Copyright 2013 Lukasz Skalski <l.skalski@partner.samsung.com>
5 USE_PWDX(NEWTOY(pwdx, "<1a", TOYFLAG_USR|TOYFLAG_BIN))
13 Print working directory of processes listed on command line.
22 for (optargs = toys.optargs; *optargs; optargs++) {
25 sprintf(toybuf, "/proc/%d/cwd", atoi(*optargs));
26 if (!readlink0(path, toybuf, sizeof(toybuf))) {
27 path = strerror(errno);
31 xprintf("%s: %s\n", *optargs, path);