PDA

View Full Version : no of processes and states



coolkiller
May 3rd, 2010, 08:26 AM
hey !!!

i want to know all the number of processes runnig or sleep and with their states ...cud any one help me ..

Dayofswords
May 3rd, 2010, 08:33 AM
'top' command displays that info on the second line

EDIT: oh this is "programming talk", this may not be what your looking for...

coolkiller
May 3rd, 2010, 09:51 AM
thanx for reply
i want to print these pcocess names ,their states,the processes made them on waiting and cpu utilization through a program in jcc i mean c language...

rnerwein
May 3rd, 2010, 08:45 PM
hi
you are familar with C programming ?
then you need: opendir, readdir, read --> in /proc/PID/stat you will find every thing you need ( you can geather much
more information about processes there )
see: man 5 proc for further information.
have fun

ciao