[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding if a process is runing.



Oded Arbel <odeda-linux-il@betalfa.org.il> writes:

> I'vre read somewhere (I think in one of perl's man pages) that you can use
> kill to send a "0 signal" to a process, to see if it is still
> runing. 

POSIX says so, AFAIK.

> kill(2) man page seems to confirm that, saying that if sig is 0, no signal
> will be sent, but error checking is till performed 

Same statement.

> I tried to use that method to check if a sub process I forked is
> still runing, and instead of returning 0 correctly (I checked with
> ps, the sub process is indeed running), it returns with the error
> code "Invalid argument". how come ?

Difficult to say. I just checked - it works for me (I can send you the
code if you like). What is this "invalid argument"? What is the errno
value? EINVAL?

-- 
Oleg Goldshmidt | ogoldshmidt@NOSPAM.computer.org 
"... We work by wit, and not by witchcraft;
 And wit depends on dilatory time." [Shakespeare]

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il