'ps' behavoir in Linux - Was - Re: array limits

Fairlight fairlite at fairlite.com
Fri Apr 16 12:37:50 PDT 2004


With neither thought nor caution, Jay Ashworth blurted:
> 
> I was talking about the SCO ps, which I believe was what he was talking
> about; procps appears to use the brackets for "not a real process; part
> of the kernel".

I didn't believe so, as he was citing auxww at some point, and that's -not-
SCO.  That's a BSD variant, and that's what proc-ps uses.

> But I could believe that /proc/$PID could be temporarily unpopulated
> for processes which were swapped out; I'm not authoritatively familiar
> with the semantics there.

man ps:
"
       Programs swapped out to disk will be shown without command
       line  arguments,  and  unless  the  c  option is given, in
       brackets.
"

So we -know- that's accurate.

And you, apparently, are correct--to an extent.  You couldn't grab your
environ file contents from /proc on a swapped out process; the virtual file
is empty.  However, you can see what fd's are in use and to what files they
point in the /proc/$PID/fd/ directories.

I didn't know that environ unpopulates when things are swapped out.
Interesting.  Whatever led you to this conclusion, you happen to be right,
and you've taught me something.  Thanks.

Incidentally, -e gives you environment settings with proc-ps.  And yes,
swapped processes turn up empty there as well--rather obviously, given
where proc-ps gets its information.  :)

mark->
-- 
Bring the web-enabling power of OneGate to -your- filePro applications today!

Try the live filePro-based, OneGate-enabled demo at the following URL:
               http://www2.onnik.com/~fairlite/flfssindex.html


More information about the Filepro-list mailing list