1846755 Members
4654 Online
110256 Solutions
New Discussion

ps command expalinations

 
SOLVED
Go to solution
George Nikoloudis_1
Frequent Advisor

ps command expalinations

I write this for second time.
I would like to ask what does it mean
143,1001 in the flags field in the ps command. How the octets are translated?
1 REPLY 1
John Palmer
Honored Contributor
Solution

Re: ps command expalinations

From /usr/include/sys/pstat.h:-
#define PS_INCORE 0x1 /* this process is in memory */
#define PS_SYS 0x2 /* this process is a system process */
#define PS_LOCKED 0x4 /* this process is locked in memory */
#define PS_TRACE 0x8 /* this process is being traced */
#define PS_TRACE2 0x10 /* this traced process has been waited for */
#define PS_TXTLOCKED 0x20 /* this process' text is locked in memory*/
#define PS_DATLOCKED 0x40 /* this process' data is locked in memory*/
#define PS_SYSCALLTRACE 0x80 /* per-process syscall tracing enabled */
#define PS_SWLAZY 0x100 /* process has associated Lazy Swap region(s) */

#define PS_64ASL 0x200 /* process has 64-bit address space layout */

You'll have to convert the Octal flags reported by ps into hex, then look them up in the list above.

143 octal = 0x63 so that the following bits are set:
0x1 /* this process is in memory */
0x2 /* this process is a system process */
0x20 /* this process' text is locked in memory*/
0x40 /* this process' data is locked in memory*/

1001 octal is 0x201 giving the following:
0x1 /* this process is in memory */
0x200 /* process has 64-bit address space layout */

Regards,
John