[comp.unix.wizards] getting process status

cat@pluto.dss.com (Iain Wacey) (05/13/91)

 I need to be able to get the current status - sleeping, runnable, etc. -
for all processes. Ineed to be able to do this within a device driver, a
streams device. This is under System V.4. How can I get this information?

Iain Wacey
cat@pluto.dss.com

boyd@prl.dec.com (Boyd Roberts) (05/14/91)

In article <4305@pluto.dss.com>, cat@pluto.dss.com (Iain Wacey) writes:
> 
>  I need to be able to get the current status - sleeping, runnable, etc. -
> for all processes. Ineed to be able to do this within a device driver, a
> streams device. This is under System V.4. How can I get this information?

You do not want to do this.  Sounds like time for a re-design and a walk into
the hall of mirrors for a good hard geek at what you're trying to do.  Device
drivers just don't do that sort of thing.

Consider the ugliness of the whole thing.  You'll have to do it at splclock(),
so things don't change while you're looking.  And then, just how long is
that search going to take?  How often will it happen?  Remember: nothing
else will run (not even interrupts) during this search.

Think _very_ carefully -- and then think again.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''