public long waitFor() { // TODO: This needs to handle multiple callers. Error? Block? waitpid can only be called once! // TODO: This needs macro handling to parse out various exit result values if (exitValue != -1) { return exitValue; } int[] status = new int[1]; int ret = posix.waitpid(pid, status, 0); exitValue = status[0]; return exitValue; }
public static void syswait(Ruby runtime, int pid) { int[] status = {0}; runtime.getPosix().waitpid(pid, status, 0); }
public static void syswait(Ruby runtime, int pid) { int[] status = {0}; runtime.getPosix().waitpid(pid, status, 0); }
public int waitpid(long pid, int[] status, int flags) { return posix().waitpid(pid, status, flags); }
public int waitpid(long pid, int[] status, int flags) { try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int waitpid(int pid, int[] status, int flags) { return posix().waitpid(pid, status, flags); }
public int waitpid(long pid, int[] status, int flags) { return posix().waitpid(pid, status, flags); }
public int waitpid(long pid, int[] status, int flags) { try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int waitpid(long pid, int[] status, int flags) { try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int waitpid(long pid, int[] status, int flags) { return posix().waitpid(pid, status, flags); }
public int waitpid(int pid, int[] status, int flags) { try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
@Override public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) { int[] status = new int[1]; Ruby runtime = context.runtime; int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0)); return RubyStatus.newProcessStatus(runtime, status[0], pid); } };
@Override public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) { int[] status = new int[1]; Ruby runtime = context.runtime; int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0)); return RubyStatus.newProcessStatus(runtime, status[0], pid); } };
public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) { int[] status = new int[1]; Ruby runtime = context.runtime; int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0)); return runtime.newFixnum(result); } };
public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) { int[] status = new int[1]; Ruby runtime = context.runtime; int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0)); return runtime.newFixnum(result); } };
@Hide(posixImpl = PosixImpl.JAVA) public static PyObject waitpid(int pid, int options) { int[] status = new int[1]; pid = posix.waitpid(pid, status, options); if (pid < 0) { throw errorFromErrno(); } return new PyTuple(Py.newInteger(pid), Py.newInteger(status[0])); }
public static IRubyObject waitpid2(Ruby runtime, IRubyObject[] args) { int pid = -1; int flags = 0; if (args.length > 0) { pid = (int)args[0].convertToInteger().getLongValue(); } if (args.length > 1) { flags = (int)args[1].convertToInteger().getLongValue(); } int[] status = new int[1]; pid = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, flags), ECHILD); return runtime.newArray(runtime.newFixnum(pid), RubyProcess.RubyStatus.newProcessStatus(runtime, (status[0] >> 8) & 0xff, pid)); }
public static IRubyObject waitpid2(Ruby runtime, IRubyObject[] args) { int pid = -1; int flags = 0; if (args.length > 0) { pid = (int)args[0].convertToInteger().getLongValue(); } if (args.length > 1) { flags = (int)args[1].convertToInteger().getLongValue(); } int[] status = new int[1]; pid = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, flags), ECHILD); return runtime.newArray(runtime.newFixnum(pid), RubyProcess.RubyStatus.newProcessStatus(runtime, (status[0] >> 8) & 0xff, pid)); }
public static long waitpid(Ruby runtime, long pid, int flags) { int[] status = new int[1]; runtime.getPosix().errno(0); pid = runtime.getPosix().waitpid(pid, status, flags); raiseErrnoIfSet(runtime, ECHILD); if (pid > 0) { runtime.getCurrentContext().setLastExitStatus(RubyProcess.RubyStatus.newProcessStatus(runtime, status[0], pid)); } else { runtime.getCurrentContext().setLastExitStatus(runtime.getNil()); } return pid; }
public static long waitpid(Ruby runtime, long pid, int flags) { int[] status = new int[1]; runtime.getPosix().errno(0); pid = runtime.getPosix().waitpid(pid, status, flags); raiseErrnoIfSet(runtime, ECHILD); if (pid > 0) { runtime.getCurrentContext().setLastExitStatus(RubyProcess.RubyStatus.newProcessStatus(runtime, status[0], pid)); } else { runtime.getCurrentContext().setLastExitStatus(runtime.getNil()); } return pid; }