From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8785583e959edcf7,start X-Google-Attributes: gidfee84,public From: Nenad Vidovic Subject: Process states from 'ps' and using a C function differ. Date: 1999/01/26 Message-ID: <36AE29FE.3461DAD8@swi.com>#1/1 X-Deja-AN: 437245960 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii NNTP-Posting-Time: 26 Jan 1999 20:48:22 GMT Organization: Interlog Internet Services Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Hi! The ps command shows several different process states: R (running), S (sleeping < 20 s), I (sleeping > 20s), T (stopped), U (uninterruptible sleeping), H (halted). On the other hand, to determine proc info from using a C function requires /usr/include/sys/procfs.h, and this file lists the states in the same way excepts for: S (sleeping), I (intermediate state of task creation). Basically, the state "I" means two different things, depending on whether the info is retrieved from "ps" or from a C function. e.g., "ps" will list 15 sleeping, 65 idle, but the C function will list 80 sleeping (i.e. a combination of S and I using "ps"), and none in the "I" state. How do we get the number of idle processes using the C function? What is the difference between the "I" state in "ps" and in procfs.h? Thanks for answers...... Regards, Nenad