home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 22899 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  2.1 KB

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