[buug] checking a pid

Will Lowe harpo at thebackrow.net
Wed Feb 26 21:11:54 PST 2003


> Well, I need this in a C program, not as something I type into the
> shell.  Setting up that full pipeline wouldn't be completely trivial.

 From "man 2 kill":

SYNOPSIS
       #include <sys/types.h>
       #include <signal.h>

       int kill(pid_t pid, int sig);

<snip...>

       If  sig  is 0, then no signal is sent, but error checking is still per-
       formed.

... so basically, if you kill(pid, 0) and it doesn't return an error,
pid is still running.

-- 
					thanks,
		
					Will



More information about the buug mailing list