public boolean isNative() { return posix().isNative(); }
public boolean isNative() { return posix().isNative(); }
private static int checkErrno(Ruby runtime, int result, NonNativeErrno nonNative) { if (result == -1) { if (runtime.getPosix().isNative()) { raiseErrnoIfSet(runtime, nonNative); } else { nonNative.handle(runtime, result); } } return result; }
private static int checkErrno(Ruby runtime, int result, NonNativeErrno nonNative) { if (result == -1) { if (runtime.getPosix().isNative()) { raiseErrnoIfSet(runtime, nonNative); } else { nonNative.handle(runtime, result); } } return result; }
private static int checkErrno(Ruby runtime, int result, NonNativeErrno nonNative) { if (result == -1) { if (runtime.getPosix().isNative()) { raiseErrnoIfSet(runtime, nonNative); } else { nonNative.handle(runtime, result); } } return result; }
private static int checkErrno(Ruby runtime, int result, NonNativeErrno nonNative) { if (result == -1) { if (runtime.getPosix().isNative()) { raiseErrnoIfSet(runtime, nonNative); } else { nonNative.handle(runtime, result); } } return result; }
@JRubyMethod(meta = true, name = "native_posix?") public static IRubyObject native_posix_p(ThreadContext context, IRubyObject self) { return context.runtime.newBoolean(context.runtime.getPosix().isNative()); }
@JRubyMethod(meta = true, name = "native_posix?") public static IRubyObject native_posix_p(ThreadContext context, IRubyObject self) { return context.runtime.newBoolean(context.runtime.getPosix().isNative()); }
@JRubyMethod(rest = true, module = true, visibility = PRIVATE) public static RubyFixnum spawn(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; if (runtime.getPosix().isNative() && !Platform.IS_WINDOWS) { return PopenExecutor.spawn(context, args); } return RubyFixnum.newFixnum(runtime, ShellLauncher.runExternalWithoutWait(runtime, args)); }
@JRubyMethod(rest = true, module = true, visibility = PRIVATE) public static RubyFixnum spawn(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; if (runtime.getPosix().isNative() && !Platform.IS_WINDOWS) { return PopenExecutor.spawn(context, args); } return RubyFixnum.newFixnum(runtime, ShellLauncher.runExternalWithoutWait(runtime, args)); }
protected static ChannelFD newChannelFD(Ruby runtime, Channel channel) { ChannelFD fd = new ChannelFD(channel, runtime.getPosix(), runtime.getFilenoUtil()); if (runtime.getPosix().isNative() && fd.realFileno >= 0 && !Platform.IS_WINDOWS) { runtime.getPosix().fcntlInt(fd.realFileno, Fcntl.F_SETFD, FcntlLibrary.FD_CLOEXEC); } return fd; }
@JRubyMethod(name = "sticky?") public IRubyObject sticky_p() { Ruby runtime = getRuntime(); if (runtime.getPosix().isNative()) { return runtime.newBoolean(stat.isSticky()); } return runtime.getNil(); }
protected static ChannelFD newChannelFD(Ruby runtime, Channel channel) { ChannelFD fd = new ChannelFD(channel, runtime.getPosix(), runtime.getFilenoUtil()); if (runtime.getPosix().isNative() && fd.realFileno >= 0 && !Platform.IS_WINDOWS) { runtime.getPosix().fcntlInt(fd.realFileno, Fcntl.F_SETFD, FcntlLibrary.FD_CLOEXEC); } return fd; }
@JRubyMethod(name = "sticky?") public IRubyObject sticky_p() { Ruby runtime = getRuntime(); if (runtime.getPosix().isNative()) { return runtime.newBoolean(stat.isSticky()); } return runtime.getNil(); }
@JRubyMethod(name = "sticky?") public IRubyObject sticky_p() { checkInitialized(); Ruby runtime = getRuntime(); if (runtime.getPosix().isNative()) { return runtime.newBoolean(stat.isSticky()); } return runtime.getNil(); }
@JRubyMethod(name = "sticky?") public IRubyObject sticky_p() { checkInitialized(); Ruby runtime = getRuntime(); if (runtime.getPosix().isNative()) { return runtime.newBoolean(stat.isSticky()); } return runtime.getNil(); }
@JRubyMethod(name = "executable_real?", required = 1, module = true) public static IRubyObject executable_real_p(IRubyObject recv, IRubyObject filename) { if (recv.getRuntime().getPosix().isNative()) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isExecutableReal()); } else { return executable_p(recv, filename); } }
@JRubyMethod(name = "executable_real?", required = 1, module = true) public static IRubyObject executable_real_p(IRubyObject recv, IRubyObject filename) { if (recv.getRuntime().getPosix().isNative()) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isExecutableReal()); } else { return executable_p(recv, filename); } }
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())); }