How to tell if a process exists

Doug Rudoff doug at ridley.coyote.trw.com
Fri Aug 3 03:50:47 AEST 1990


In a C program, how do you tell if a certain process exists? A
kill(0,pid) works only if you own the process (or you're root). It
seems like such a simple thing to request that it should be part of
the standard C libraries for unix, but I can't seem to find the right
thing to use.

The reason I need this is that I have a user interface that depends on
another prcoess to exist to run properly. The other process writes its
process id to a file and then I want the user interface to check to
see if that process id is still there. Is there a better way to do
this?

I'm running Ultrix 3.1D on a DECstation 3100.
--
=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Doug Rudoff            Mobile Data International   Bothell, WA
(206) 487-5937         rudoff at mdi.com, uunet!mdisea!rudoff
=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



More information about the Comp.unix.questions mailing list