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