PID status

Given a PID ( suppose 1356) . How do i tell if its running or not

It would be really helpful if you could explain me ..

I got this answer from google but i am unable to understand it

**********************************************

Use kill() with 0 for the signal number.
There are four possible results from this call:
kill() returns 0

this implies that a process exists with the given PID, and the system
would allow you to send signals to it. It is system-dependent whether
the process could be a zombie.

kill() returns @math{-1}, errno == ESRCH

either no process exists with the given PID, or security enhancements
are causing the system to deny its existence. (On some systems, the
process could be a zombie.)

kill() returns @math{-1}, errno == EPERM

the system would not allow you to kill the specified process. This
means that either the process exists (again, it could be a zombie) or
draconian security enhancements are present (e.g. your process is not
allowed to send signals to anybody).

kill() returns @math{-1}, with some other value of errno

you are in trouble!

***********************************************

Hello,
As long as you see your PID in ps command output, your process is running. If you want to check your PID's parent/child process you can use ptree <PID>

-Nithin.

To get parent/child processes from a pid I do the following on a sco unix box:

ps -ef | grep pid#

ok thanks that was really clever way out ..

Google confused me ....

And as an addition you can use pargs <PID> to check the arguments of the process.

Besides you can check /proc directory too

Regards