public RLimit getrlimit(int resource) { return posix().getrlimit(resource); }
public int getrlimit(int resource, RLimit rlim) { return posix().getrlimit(resource, rlim); }
public int getrlimit(int resource, Pointer rlim) { return posix().getrlimit(resource, rlim); }
public int getrlimit(int resource, Pointer rlim) { return posix().getrlimit(resource, rlim); }
public RLimit getrlimit(int resource) { return posix().getrlimit(resource); }
public int getrlimit(int resource, RLimit rlim) { try { return posix.getrlimit(resource, rlim); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int getrlimit(int resource, Pointer rlim) { try { return posix.getrlimit(resource, rlim); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int getrlimit(int resource, RLimit rlim) { return posix().getrlimit(resource, rlim); }
public int getrlimit(int resource, Pointer rlim) { return posix().getrlimit(resource, rlim); }
public int getrlimit(int resource, RLimit rlim) { try { return posix.getrlimit(resource, rlim); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public RLimit getrlimit(int resource) { return posix().getrlimit(resource); }
public RLimit getrlimit(int resource) { try { return posix.getrlimit(resource); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public int getrlimit(int resource, Pointer rlim) { try { return posix.getrlimit(resource, rlim); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public RLimit getrlimit(int resource) { try { return posix.getrlimit(resource); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
public int getrlimit(int resource, Pointer rlim) { try { return posix.getrlimit(resource, rlim); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public RLimit getrlimit(int resource) { try { return posix.getrlimit(resource); } catch (UnsatisfiedLinkError ule) { return unimplementedNull(); } }
@JRubyMethod(name = "setrlimit", module = true, visibility = PRIVATE) public static IRubyObject setrlimit(ThreadContext context, IRubyObject recv, IRubyObject resource, IRubyObject rlimCur, IRubyObject rlimMax) { Ruby runtime = context.runtime; RLimit rlim = runtime.getPosix().getrlimit(0); if (rlimMax == context.nil) rlimMax = rlimCur; rlim.init(rlimitResourceValue(runtime, rlimCur), rlimitResourceValue(runtime, rlimMax)); if (runtime.getPosix().setrlimit(rlimitResourceType(runtime, resource), rlim) < 0) { throw runtime.newErrnoFromInt(runtime.getPosix().errno(), "setrlimit"); } return context.nil; }
@JRubyMethod(name = "setrlimit", module = true, visibility = PRIVATE) public static IRubyObject setrlimit(ThreadContext context, IRubyObject recv, IRubyObject resource, IRubyObject rlimCur, IRubyObject rlimMax) { Ruby runtime = context.runtime; RLimit rlim = runtime.getPosix().getrlimit(0); if (rlimMax == context.nil) rlimMax = rlimCur; rlim.init(rlimitResourceValue(runtime, rlimCur), rlimitResourceValue(runtime, rlimMax)); if (runtime.getPosix().setrlimit(rlimitResourceType(runtime, resource), rlim) < 0) { throw runtime.newErrnoFromInt(runtime.getPosix().errno(), "setrlimit"); } return context.nil; }
public static IRubyObject getrlimit(Ruby runtime, IRubyObject arg) { if (!runtime.getPosix().isNative() || Platform.IS_WINDOWS) { runtime.getWarnings().warn("Process#getrlimit not supported on this platform"); return runtime.newFixnum(Long.MAX_VALUE); } RLimit rlimit = runtime.getPosix().getrlimit(rlimitResourceType(runtime, arg)); return runtime.newArray(runtime.newFixnum(rlimit.rlimCur()), runtime.newFixnum(rlimit.rlimMax())); }
public static IRubyObject getrlimit(Ruby runtime, IRubyObject arg) { if (!runtime.getPosix().isNative() || Platform.IS_WINDOWS) { runtime.getWarnings().warn("Process#getrlimit not supported on this platform"); return runtime.newFixnum(Long.MAX_VALUE); } RLimit rlimit = runtime.getPosix().getrlimit(rlimitResourceType(runtime, arg)); return runtime.newArray(runtime.newFixnum(rlimit.rlimCur()), runtime.newFixnum(rlimit.rlimMax())); }