/proc/NNNNN accuracy

From: Jem Berkes (jb@users.pc9.org)
Date: 12/17/02


From: Jem Berkes <jb@users.pc9.org>
Date: Tue, 17 Dec 2002 17:54:32 GMT

I just discovered this today... the PID directories in the /proc filesystem
that refer to running processes (with all kinds of nice info, command line,
status, etc.!)

This is interesting for me because it appears that I can read these files
and directories directly with my scripts.

BUT: is the /proc/pid information accurate? Can a process hide itself by
deleting its associated subdirectory? Or is this list definitive?

I realize a running program could change its command line etc. to make it
appear like a different program. That aside, what I'm trying to get 100%
accurate info on is: the uid the program is running under, and whether it's
running. Does the /proc/pid structure give this with total accuracy?

-- 
Jem Berkes
http://www.pc-tools.net/
Windows, Linux & UNIX software


Relevant Pages