private Process findZombie(Pid pid) throws UnixException {
   Process process = mZombies.remove(pid);
   if (process != null) {
     return process;
   }
   if (!mProcesses.contains(pid)) {
     // Another thread got the zombie.
     throw new UnixException(Errno.ECHILD);
   }
   return null;
 }