in reply to Checking PIDs without system calls

A cheap hack, but will depend on how your OS operates:      if (-d "/proc/$pid") { ... } This will likely work with most UNIX variants. As a bonus, you can examine the command line parameters of that process to see if it's the one you were expecting. On Linux, at least, this is available in a pseudo-file:
sub GetProcessCommand { my ($pid) = @_; return (open (PID, "/proc/$pid/cmdline") && <PID>); }
This way you can validate the "authenticity" of the process1:
# Check for buddy named 'xyz-proc' if (GetProcessCommand($pid) =~ /xyz\-proc/) { ... }
Sometimes you will find a process active in that slot, but for some reason it isn't yours.
1. This "authentication" is pretty loose, so be sure to check the owner of the process too. You can masquerade your process as anything you like by setting $0, after all, but you can't change the uid of the process so easily.