How to tell if a process is active?

Mike Wescott wescott at ncrcae.Columbia.NCR.COM
Thu Jun 15 23:14:52 AEST 1989


In article <2727 at infocenter.UUCP> mhoffman at infocenter.UUCP (Mike Hoffman) writes:
> 
> I have an application in which I need to check to see if a process
> is currently active. 

Try:

isactive(pid)
	if(kill(pid,0)==0 || errno == EPERM)
		return(process is active)
	else 
		return(process is not active)

see kill(2).

-- 
	-Mike Wescott
	 mike.wescott at ncrcae.Columbia.NCR.COM



More information about the Comp.unix.questions mailing list