support -H flag for hard limits

This commit is contained in:
Doug MacEachern 2005-07-22 01:04:51 +00:00
parent 114c26d6c6
commit 081c28ff77

View File

@ -24,6 +24,10 @@ public class Ulimit extends SigarCommandBase {
return "Display system resource limits"; return "Display system resource limits";
} }
protected boolean validateArgs(String[] args) {
return true;
}
private static String format(long val) { private static String format(long val) {
if (val == ResourceLimit.INFINITY()) { if (val == ResourceLimit.INFINITY()) {
return "unlimited"; return "unlimited";
@ -41,10 +45,22 @@ public class Ulimit extends SigarCommandBase {
public void output(String[] args) throws SigarException { public void output(String[] args) throws SigarException {
this.mode = "Cur";
this.invoker = this.invoker =
SigarInvokerJMX.getInstance(this.proxy, "Type=ResourceLimit"); SigarInvokerJMX.getInstance(this.proxy, "Type=ResourceLimit");
for (int i=0; i<args.length; i++) {
String arg = args[i];
if (arg.equals("-H")) {
this.mode = "Max";
}
else if (arg.equals("-S")) {
this.mode = "Cur"; this.mode = "Cur";
}
else {
throw new SigarException("Unknown argument: " + arg);
}
}
println("core file size......." + getValue("Core")); println("core file size......." + getValue("Core"));
println("data seg size........" + getValue("Data")); println("data seg size........" + getValue("Data"));