docs: public static int procWait (Process process, final long timeout) throws OSHelperException {
  		long endTime = Calendar.getInstance ().getTimeInMillis () + timeout;
  
  		boolean terminatedByItself = false;
  		int toReturn = 0;
  
  		while (Calendar.getInstance ().getTimeInMillis () < endTime) {
  			try {
  				process.exitValue ();
  				terminatedByItself = true;
  				toReturn = osh_PROCESS_EXITED_BY_ITSELF;
  			} catch (IllegalThreadStateException ex) {
  				terminatedByItself = false;
  			}
  			if (terminatedByItself) {
  				break;
  			}
  		}
  		if (!terminatedByItself) {
  			process.destroy ();
  
  			try {
  				process.waitFor ();
  			} catch (InterruptedException ex) {
  				throw new OSHelperException (ex);
  			}
  
  			toReturn = osh_PROCESS_KILLED_BY_TIMEOUT;
  		}
  
  		return toReturn;
  	}