equal
deleted
inserted
replaced
660 |
660 |
661 if (getPsinfo(pid, &psinfo) < 0) { |
661 if (getPsinfo(pid, &psinfo) < 0) { |
662 return -1; |
662 return -1; |
663 } |
663 } |
664 |
664 |
|
665 // Validate the pid before returning the info in case /proc/pid is racy |
|
666 if (kill(pid, 0) < 0) { |
|
667 return -1; |
|
668 } |
|
669 |
665 *totalTime = psinfo.pr_time.tv_sec * 1000000000L + psinfo.pr_time.tv_nsec; |
670 *totalTime = psinfo.pr_time.tv_sec * 1000000000L + psinfo.pr_time.tv_nsec; |
666 |
671 |
667 *startTime = psinfo.pr_start.tv_sec * (jlong)1000 + |
672 *startTime = psinfo.pr_start.tv_sec * (jlong)1000 + |
668 psinfo.pr_start.tv_nsec / 1000000; |
673 psinfo.pr_start.tv_nsec / 1000000; |
669 |
674 |