9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Derek Fawcus <dfawcus@cisco.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] plan 9 ports to unix (including libdraw)
Date: Fri, 17 Oct 2003 21:35:48 +0100	[thread overview]
Message-ID: <20031017213548.H23130@edinburgh.cisco.com> (raw)
In-Reply-To: <OFB2D3336F.6270B83B-ON85256DC2.0063E4FF@com>; from cjones83@csc.com on Fri, Oct 17, 2003 at 02:21:22PM -0400

On Fri, Oct 17, 2003 at 02:21:22PM -0400, Caerwyn B Jones wrote:
>
> The tricky bit is to get the current working directory of the shell.
> On Solaris it's possible to use /proc/n/cwd to find it out. There's
> probably an equivalent on Linux.

Well from the below,  it's similar.  I believe that readlink() on
/proc/n/cwd (for linux) will get what you want.  I'm not sure what
one does on solaris.

DF

Solaris:

$ ls -l /proc/$$
total 2717
-rw-------   1 dfawcus   2752512 Oct 16 19:09 as
-r--------   1 dfawcus       152 Oct 16 19:09 auxv
-r--------   1 dfawcus        36 Oct 16 19:09 cred
--w-------   1 dfawcus         0 Oct 16 19:09 ctl
lr-x------   1 dfawcus         0 Oct 16 19:09 cwd ->
dr-x------   2 dfawcus      8208 Oct 16 19:09 fd
-r--r--r--   1 dfawcus       120 Oct 16 19:09 lpsinfo
-r--------   1 dfawcus       912 Oct 16 19:09 lstatus
-r--r--r--   1 dfawcus       536 Oct 16 19:09 lusage
dr-xr-xr-x   3 dfawcus        48 Oct 16 19:09 lwp
-r--------   1 dfawcus      2304 Oct 16 19:09 map
dr-x------   2 dfawcus       544 Oct 16 19:09 object
-r--------   1 dfawcus      2776 Oct 16 19:09 pagedata
-r--r--r--   1 dfawcus       336 Oct 16 19:09 psinfo
-r--------   1 dfawcus      2304 Oct 16 19:09 rmap
lr-x------   1 dfawcus         0 Oct 16 19:09 root ->
-r--------   1 dfawcus      1440 Oct 16 19:09 sigact
-r--------   1 dfawcus      1232 Oct 16 19:09 status
-r--r--r--   1 dfawcus       256 Oct 16 19:09 usage
-r--------   1 dfawcus         0 Oct 16 19:09 watch
-r--------   1 dfawcus      3648 Oct 16 19:09 xmap

Linux:

; ls -l /proc/$pid
total 0
-r--r--r--    1 dfawcus  dfawcus         0 Oct 17 21:28 cmdline
lrwxrwxrwx    1 dfawcus  dfawcus         0 Oct 17 21:28 cwd -> /home/dfawcus
-r--------    1 dfawcus  dfawcus         0 Oct 17 21:28 environ
lrwxrwxrwx    1 dfawcus  dfawcus         0 Oct 17 21:28 exe -> /usr/packages/rc-1.6b3/bin/rc-el
dr-x------    2 dfawcus  dfawcus         0 Oct 17 21:28 fd
-r--r--r--    1 dfawcus  dfawcus         0 Oct 17 21:28 maps
-rw-------    1 dfawcus  dfawcus         0 Oct 17 21:28 mem
lrwxrwxrwx    1 dfawcus  dfawcus         0 Oct 17 21:28 root -> /
-r--r--r--    1 dfawcus  dfawcus         0 Oct 17 21:28 stat
-r--r--r--    1 dfawcus  dfawcus         0 Oct 17 21:28 statm
-r--r--r--    1 dfawcus  dfawcus         0 Oct 17 21:28 status



  reply	other threads:[~2003-10-17 20:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-17 18:21 Caerwyn B Jones
2003-10-17 20:35 ` Derek Fawcus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-17 16:30 David Presotto
2003-10-20  2:01 ` okamoto
2003-10-20  6:33   ` Nigel Roles
2003-10-20  8:29   ` Charles Forsyth
2003-10-20  8:45     ` Fco.J.Ballesteros
2003-10-20  8:45     ` okamoto
2003-10-20  8:50       ` Fco.J.Ballesteros
2003-10-20 17:21   ` ron minnich
2003-10-20 19:30     ` Charles Forsyth
2003-10-20 19:40       ` ron minnich
2003-10-20 20:07         ` mirtchov
2003-10-20 20:14           ` ron minnich
2003-10-20 21:08             ` David Presotto
2003-10-20 21:08           ` Enache Adrian
2003-10-20 21:17             ` mirtchov
2003-10-20 21:23               ` Scott Schwartz
2003-10-20 21:39                 ` Skip Tavakkolian
2003-10-20 23:12     ` Geoff Collyer
2003-10-21  1:16       ` okamoto
2003-10-21  2:48         ` okamoto
2003-10-21  3:23       ` Russ Cox
2003-10-21  3:33         ` okamoto
2003-10-21  3:56           ` Russ Cox
2003-10-21  4:01             ` ron minnich
2003-10-21 12:05               ` David Presotto
2003-10-21  6:28             ` Nigel Roles
2003-10-21  7:37             ` Richard Miller
2003-10-22  2:01               ` Adrian Tritschler
2003-10-21  9:39       ` a
2003-10-21 14:01     ` paurea
2003-10-21 16:05       ` C H Forsyth
2003-10-21 17:11         ` Fco.J.Ballesteros
2003-10-21 11:20           ` Charles Forsyth
2003-10-17 15:48 matt
2003-10-17 16:02 ` Nigel Roles
2003-10-17 16:14   ` matt
2003-10-17 15:13 Richard C Bilson
2003-10-17 13:03 Caerwyn B Jones
2003-10-13 18:31 Russ Cox
2003-10-13 21:34 ` Caerwyn Jones
2003-10-14  0:53 ` arisawa
2003-10-14 18:09 ` andrey mirtchovski
2003-10-14 18:10 ` andrey mirtchovski
2003-10-17  2:53 ` Richard C Bilson
2003-10-17  3:02   ` William Josephson
2003-10-17  9:42   ` a
2003-10-17 14:30   ` Joel Salomon
2003-10-17 14:38     ` Joel Salomon
2003-10-17 23:57       ` Bruce Ellis
2003-10-17 17:25   ` Roman Shaposhnick
2003-10-17 18:00     ` matt
2003-10-17 18:06       ` Roman Shaposhnick
2003-10-17 21:16         ` matt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031017213548.H23130@edinburgh.cisco.com \
    --to=dfawcus@cisco.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).