code: private List<Integer> getProcessList() {
      String[] processDirs = (new File(procfsDir)).list();
      List<Integer> processList = new ArrayList<Integer>();
  
      for (String dir : processDirs) {
        try {
          int pd = Integer.parseInt(dir);
          if ((new File(procfsDir, dir)).isDirectory()) {
            processList.add(Integer.valueOf(pd));
          }
        } catch (NumberFormatException n) {
          // skip this directory
        } catch (SecurityException s) {
          // skip this process
        }
      }
      return processList;
    }
docs: Get the list of all processes in the system.