home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!bnr.co.uk!uknet!warwick!dcs.warwick.ac.uk!alfie
- From: alfie@dcs.warwick.ac.uk (Nick Holloway)
- Newsgroups: comp.os.linux
- Subject: Re: /proc inquiry
- Message-ID: <1993Jan6.123333.12705@dcs.warwick.ac.uk>
- Date: 6 Jan 93 12:33:33 GMT
- References: <1993Jan5.183447.27930@walter.cray.com>
- Sender: news@dcs.warwick.ac.uk (Network News)
- Organization: Department of Computer Science, Warwick University, England
- Lines: 44
- Nntp-Posting-Host: box
-
- In <1993Jan5.183447.27930@walter.cray.com> roberts@decsun3.cray.com writes:
- > which works fine, I can "cd /proc" and see directories for each process.
- > However, when I go into any of these, the links point nowhere:
- >
- > cwd -> ---
- > exe -> ---
- > root -> ---
-
- I was impressed with the /proc directory when I installed Linux on two
- friends machines (*), but was a little disappointed by what readlink()
- returns for these things. I did realise that you actually had to open
- them to get the info.
-
- However, this is not very useful at the shell level. At first I thought
- that the actual file name would be useful, but then realised that this
- is a) overhead, b) not necessarily possible (0 or many links), c) not
- necessarily wanted.
-
- But, as an alternative, how about the mount point and inode? This could
- lead to simple programs to find out which processes are preventing a
- filesystem being unmounted, and would be more aesthetically pleasing.
- It could mean a /proc based 'lsof'.
-
- cwd -> /users,922
-
- As an alternative, it could just be the "dev,ino" pair. This would
- mean looking up what the mount point for a particular device was, but
- quite possible.
-
- cwd -> 1617,9992
-
- This has the advantage of being easy to parse (I might have a mount
- point called "/awkward,directory" :-)
-
- A quick random thought -- how does /proc deal with inet socket
- connections?
-
- --
- Nick Holloway | `O O' | alfie@dcs.warwick.ac.uk, alfie@warwick.UUCP,
- [aka `Alfie'] | // ^ \\ | ..!uunet!mcsun!uknet!warwick!alfie
- ----
- (*) I'm so impressed with what I have heard and seen of Linux, I shall
- be purchasing a machine in the near future, and installing it. Then
- hopefully I can contribute with code, rather than just ideas.
-