Checking if a process exists, reguardless of uid,euid

Dave Lee dave at dptechno.uucp
Thu Sep 6 03:48:29 AEST 1990


I saw this hashed around a bunch a while back, but I did not see 
a definate answer.   

Will the following function always determine if the supplied process
id (pid) is currently running *** reguardless *** of the effective
and actual id's of the calling process and the supplied process ?

It does work with HP-UX 7.0 in all cases I could try.

Is this different for BSD versions and  SYS V ? 
What does POSIX and SVID2 have to say about this? 


#include <errno.h>
IsAlive( pid )
int  pid;
{
        int ret;
        extern int errno;
        errno = 0;
        ret = kill( pid , 0 );
        return( ret == 0 || errno == EPERM );
}


Email or post at your convience.
Thanks a bunch ...

-- 
Dave Lee
uunet!dptechno!dave



More information about the Comp.unix.misc mailing list