Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

kill semantics.



Hi,

I've been playing around with kill(2) lately. Specifically, I'd like
to use a resource lock-file from a script. The lock-file contains the
PID of the process locking the resource.

To verify whether the lock-file is stale, the script should test whether
the PID still exists. Kill(2) has a neat feature for this:


kill(2)

NAME
  kill - Sends a signal to a process or to a group of processes

[...]
  signal    Specifies the signal. If the signal parameter is a value of 0
            (the null signal), error checking is performed but no signal is
            sent. This can be used to check the validity of the process
            parameter.

This seems to work from ZSH as well: "kill -0 PID" does the check
fine.  But it is not documented. Which makes me think: is this system
specific?

Regards,

-- 
Rob W. W. Hooft ====== You have a computational protein problem? Try WHAT IF! 
= Rob.Hooft@xxxxxxxxxxxxxxxxxx, Meyerhofstr. 1, 69117 Heidelberg, Germany. ==
3.0GS$ d-(?) s: a28 C++ UAIOS++(-) UL++++ P++ L++(+++) E++ W++(-) N++(+++) K?
w-- O? M-(--) V(-) PS PE+ Y+ PGP t 5? X+ R tv+ b+ DI? D+ G+ e++++ h(*) !r !y+



Messages sorted by: Reverse Date, Date, Thread, Author