Access to kmem - System namelist - 'ps' etc
John Gilmore
gnu at sun.uucp
Thu Dec 13 18:30:32 AEST 1984
> Just a hint... Other systems have been faced with this problem in the
> past. It might be worth looking around to see how others have addressed it.
The Data General AOS and AOS/VS systems solved this problem cleanly.
(Actually I'm impressed, now that I've seen Unix, at HOW cleanly they
built a system with just about all the features of Unix, with many
fewer wild kludges and many more features.) One of the defined system
calls took a PID as argument and returned a struct giving info about
the process. Think of it as "stat" on a process instead of a file.
There was no reason to restrict access to this system call, so you
could do it on any process. To find all the jobs in the system, start
at pid 1 and recurse asking about all its daughters (that's part of the
info returned). Note that the struct returned need not correspond to
any particular data structure in the kernel, but can be built at the
time you ask for it.
Now maybe it took a day longer to write than 'ps', but in cleanliness
it is certainly is closer to Heaven.
More information about the Comp.unix.wizards
mailing list