+ return undef;
+}
+
+sub check_process_running {
+ my ($pid, $pstart) = @_;
+
+ # note: waitpid only work for child processes, but not
+ # for processes spanned by other processes.
+ # kill(0, pid) return succes for zombies.
+ # So we read the status form /proc/$pid/stat instead
+
+ my $info = read_proc_pid_stat($pid);
+
+ return $info && ($info->{starttime} eq $pstart) && ($info->{status} ne 'Z') ? $info : undef;
+}
+
+sub read_proc_starttime {
+ my $pid = shift;
+
+ my $info = read_proc_pid_stat($pid);
+ return $info ? $info->{starttime} : 0;