353 if (!p.waitFor(timeout, TimeUnit.SECONDS)) {
354 System.out.printf("waitFor timed out: %d%n", timeout);
355 }
356 } catch (InterruptedException ie) {
357 throw new IOException("interrupted", ie);
358 }
359 ps.println();
360 } catch (IOException ioe) {
361 throw new UncheckedIOException("error listing file descriptors", ioe);
362 }
363 });
364 }
365
366 // Possible command locations and arguments
367 static String[][] lsCommands = new String[][] {
368 {"/usr/bin/lsof", "-p"},
369 {"/usr/sbin/lsof", "-p"},
370 {"/bin/lsof", "-p"},
371 {"/sbin/lsof", "-p"},
372 {"/usr/local/bin/lsof", "-p"},
373 {"/usr/bin/pfiles", "-F"}, // Solaris
374 };
375 }
|
353 if (!p.waitFor(timeout, TimeUnit.SECONDS)) {
354 System.out.printf("waitFor timed out: %d%n", timeout);
355 }
356 } catch (InterruptedException ie) {
357 throw new IOException("interrupted", ie);
358 }
359 ps.println();
360 } catch (IOException ioe) {
361 throw new UncheckedIOException("error listing file descriptors", ioe);
362 }
363 });
364 }
365
366 // Possible command locations and arguments
367 static String[][] lsCommands = new String[][] {
368 {"/usr/bin/lsof", "-p"},
369 {"/usr/sbin/lsof", "-p"},
370 {"/bin/lsof", "-p"},
371 {"/sbin/lsof", "-p"},
372 {"/usr/local/bin/lsof", "-p"},
373 };
374 }
|