home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / linux / 20404 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  1.6 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!my!omega!lysator.liu.se!aronsson
  2. From: aronsson@lysator.liu.se (Lars Aronsson)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: ps that uses /proc
  5. Message-ID: <Bz9qEx.Jp6@lysator.liu.se>
  6. Date: 14 Dec 92 21:30:32 GMT
  7. References: <1992Dec14.032831.9921@u.washington.edu>
  8. Organization: Lysator Academic Computer Society, Linkoping University, Sweden
  9. Lines: 28
  10.  
  11. barr@stein.u.washington.edu (David Barr) writes:
  12. >Has anyone written a version of ps that uses the proc file system?  I
  13.  
  14. David, first, this posting is not an attack on your fine program.
  15.  
  16. >are a few major disadvantages of my program.  Because I wrote it in a
  17. >hurry, the output is kind of non-standard and there are only 3 options
  18.  
  19. What I would like to know is whether the INPUT follows any standard.
  20. The presented program relies on the present file tree structure under
  21. /proc. Will this structure stay the same for ever? Is it mentioned in
  22. POSIX? Will it look the same in other operating systems? Otherwise,
  23. does POSIX mention any system call or ioctl(2) operation to retrieve
  24. information necessary for ps(1)? Could we finally, in some way or
  25. another, write a portable ps(1) program?
  26.  
  27. In my mind, guessing about the file tree structure under /proc is
  28. almost as primitive (not more primitive) as guessing about the
  29. contents of /dev/kmem.
  30.  
  31. >  sprintf(filename, "/proc/%s/%s", ent->d_name, what);
  32. >  proc = opendir("/proc");
  33. >    sprintf(filename, "/proc/%s", ent->d_name);
  34.  
  35. If there is no standard, maybe we should write one and send a copy to
  36. the POSIX guys at IEEE.
  37. -- 
  38. Lars Aronsson, Lysator, Linkoping University, Linkoping, Sweden
  39.