Re: patches and responses...

On 08/23/00 14:01:58 +0100, kevin lyda <> wrote:
| i peek in the term variable to get the child's pid (the shell).  i
| then do a readlink on /proc/<pid>/cwd to get the cwd.  obviously on
| systems that don't support /proc/<pid>/cwd this call will fail and this
| bit of info won't be stored.  i hope a solaris person can tweak this for
| their systems, etc.

Works as is on Solaris 7 and later... with a caveat:

3@hilfy:217 Z# ls -l /proc/12079/cwd
lr-x------   1 root     other           0 Aug 23 09:21 /proc/12079/cwd -> /
3@hilfy:218 Z# /usr/proc/bin/pwdx 12079
12079:	/home/allbery/bld/gnome-network/network-utilities/CVS

It's more like linux 2.0 cwd symlinks than linux 2.2 cwd symlinks; you need 
to actually follow it to find its target.  Or use /usr/proc/bin/pwdx as 
above (which works on all versions of Solaris from 2.4 (I think) on, so is 
maximally compatible).

brandon s. allbery     [os/2][linux][solaris][japh]
system administrator        [WAY too many hats]
electrical and computer engineering                                    KF8NH
carnegie mellon university      ["better check the oblivious first" -ke6sls]

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]