pwdx: cannot resolve cwd for 6239 : No such file or directory
When I tried to check the current work directory of a process, it failed with the message as shown in the title.
I looked up some articles saying this is because the program I launched from within a directory that is later removed. But I don't think the directory is removed. So I am confused why this happen.
And I checked the implementation of the pwdx.c, and found:
void) snprintf(proc, sizeof (proc), [b]"/proc/%d/path/cwd[/b]",(int)p.pr_pid);
if ((ret = readlink(proc, cwd, sizeof (cwd) - 1)) <= 0)
The code is checking, e.g. /proc/6239/path/cwd. But in the /proc filesystem, I didn't see any "path" in the directory, e.g. /proc/972/cwd
How can I check if my system is using this implementation? Will this be the root cause of the problem?
Thanks in advance.

