docs: private void cleanupProcess(LinuxProcess linuxProcess, int stdinFd, int stdoutFd, int stderrFd)
     {
        pidToProcessMap.remove(linuxProcess.getPid());
        fildesToProcessMap.remove(stdinFd);
        fildesToProcessMap.remove(stdoutFd);
        fildesToProcessMap.remove(stderrFd);
  
        //        linuxProcess.close(linuxProcess.getStdin());
        //        linuxProcess.close(linuxProcess.getStdout());
        //        linuxProcess.close(linuxProcess.getStderr());
  
        if (linuxProcess.cleanlyExitedBeforeProcess.get()) {
           linuxProcess.onExit(0);
           return;
        }
  
        IntByReference ret = new IntByReference();
        int rc = LibC.waitpid(linuxProcess.getPid(), ret, LibC.WNOHANG);
  
        if (rc == 0) {
           deadPool.add(linuxProcess);
        }
        else if (rc < 0) {
           linuxProcess.onExit((Native.getLastError() == LibC.ECHILD) ? Integer.MAX_VALUE : Integer.MIN_VALUE);
        }
        else {
           handleExit(linuxProcess, ret.getValue());
        }
     }