jnr.posix.POSIX.waitpid()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中jnr.posix.POSIX.waitpid()方法的一些代码示例,展示了POSIX.waitpid()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POSIX.waitpid()方法的具体详情如下:
包路径:jnr.posix.POSIX
类名称:POSIX
方法名:waitpid

POSIX.waitpid介绍

暂无

代码示例

代码示例来源:origin: com.github.jnr/jnr-process

  1. public long waitFor() {
  2. // TODO: This needs to handle multiple callers. Error? Block? waitpid can only be called once!
  3. // TODO: This needs macro handling to parse out various exit result values
  4. if (exitValue != -1) {
  5. return exitValue;
  6. }
  7. int[] status = new int[1];
  8. int ret = posix.waitpid(pid, status, 0);
  9. exitValue = status[0];
  10. return exitValue;
  11. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public static void syswait(Ruby runtime, int pid) {
  2. int[] status = {0};
  3. runtime.getPosix().waitpid(pid, status, 0);
  4. }

代码示例来源:origin: org.jruby/jruby-core

  1. public static void syswait(Ruby runtime, int pid) {
  2. int[] status = {0};
  3. runtime.getPosix().waitpid(pid, status, 0);
  4. }

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

  1. public int waitpid(long pid, int[] status, int flags) {
  2. return posix().waitpid(pid, status, flags);
  3. }

代码示例来源:origin: com.github.jnr/jnr-posix

  1. public int waitpid(long pid, int[] status, int flags) {
  2. try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

代码示例来源:origin: com.cloudbees.util/jnr-unixsocket-nodep

  1. public int waitpid(int pid, int[] status, int flags) {
  2. return posix().waitpid(pid, status, flags);
  3. }

代码示例来源:origin: com.github.jnr/jnr-posix

  1. public int waitpid(long pid, int[] status, int flags) {
  2. return posix().waitpid(pid, status, flags);
  3. }

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver

  1. public int waitpid(long pid, int[] status, int flags) {
  2. try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

  1. public int waitpid(long pid, int[] status, int flags) {
  2. try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

代码示例来源:origin: io.prestosql.cassandra/cassandra-driver

  1. public int waitpid(long pid, int[] status, int flags) {
  2. return posix().waitpid(pid, status, flags);
  3. }

代码示例来源:origin: com.cloudbees.util/jnr-unixsocket-nodep

  1. public int waitpid(int pid, int[] status, int flags) {
  2. try { return posix.waitpid(pid, status, flags); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

代码示例来源:origin: org.jruby/jruby-complete

  1. @Override
  2. public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) {
  3. int[] status = new int[1];
  4. Ruby runtime = context.runtime;
  5. int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0));
  6. return RubyStatus.newProcessStatus(runtime, status[0], pid);
  7. }
  8. };

代码示例来源:origin: org.jruby/jruby-core

  1. @Override
  2. public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) {
  3. int[] status = new int[1];
  4. Ruby runtime = context.runtime;
  5. int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0));
  6. return RubyStatus.newProcessStatus(runtime, status[0], pid);
  7. }
  8. };

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) {
  2. int[] status = new int[1];
  3. Ruby runtime = context.runtime;
  4. int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0));
  5. return runtime.newFixnum(result);
  6. }
  7. };

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block) {
  2. int[] status = new int[1];
  3. Ruby runtime = context.runtime;
  4. int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0));
  5. return runtime.newFixnum(result);
  6. }
  7. };

代码示例来源:origin: org.python/jython

  1. @Hide(posixImpl = PosixImpl.JAVA)
  2. public static PyObject waitpid(int pid, int options) {
  3. int[] status = new int[1];
  4. pid = posix.waitpid(pid, status, options);
  5. if (pid < 0) {
  6. throw errorFromErrno();
  7. }
  8. return new PyTuple(Py.newInteger(pid), Py.newInteger(status[0]));
  9. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. public static IRubyObject waitpid2(Ruby runtime, IRubyObject[] args) {
  2. int pid = -1;
  3. int flags = 0;
  4. if (args.length > 0) {
  5. pid = (int)args[0].convertToInteger().getLongValue();
  6. }
  7. if (args.length > 1) {
  8. flags = (int)args[1].convertToInteger().getLongValue();
  9. }
  10. int[] status = new int[1];
  11. pid = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, flags), ECHILD);
  12. return runtime.newArray(runtime.newFixnum(pid), RubyProcess.RubyStatus.newProcessStatus(runtime, (status[0] >> 8) & 0xff, pid));
  13. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. public static IRubyObject waitpid2(Ruby runtime, IRubyObject[] args) {
  2. int pid = -1;
  3. int flags = 0;
  4. if (args.length > 0) {
  5. pid = (int)args[0].convertToInteger().getLongValue();
  6. }
  7. if (args.length > 1) {
  8. flags = (int)args[1].convertToInteger().getLongValue();
  9. }
  10. int[] status = new int[1];
  11. pid = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, flags), ECHILD);
  12. return runtime.newArray(runtime.newFixnum(pid), RubyProcess.RubyStatus.newProcessStatus(runtime, (status[0] >> 8) & 0xff, pid));
  13. }

代码示例来源:origin: org.jruby/jruby-complete

  1. public static long waitpid(Ruby runtime, long pid, int flags) {
  2. int[] status = new int[1];
  3. runtime.getPosix().errno(0);
  4. pid = runtime.getPosix().waitpid(pid, status, flags);
  5. raiseErrnoIfSet(runtime, ECHILD);
  6. if (pid > 0) {
  7. runtime.getCurrentContext().setLastExitStatus(RubyProcess.RubyStatus.newProcessStatus(runtime, status[0], pid));
  8. }
  9. else {
  10. runtime.getCurrentContext().setLastExitStatus(runtime.getNil());
  11. }
  12. return pid;
  13. }

代码示例来源:origin: org.jruby/jruby-core

  1. public static long waitpid(Ruby runtime, long pid, int flags) {
  2. int[] status = new int[1];
  3. runtime.getPosix().errno(0);
  4. pid = runtime.getPosix().waitpid(pid, status, flags);
  5. raiseErrnoIfSet(runtime, ECHILD);
  6. if (pid > 0) {
  7. runtime.getCurrentContext().setLastExitStatus(RubyProcess.RubyStatus.newProcessStatus(runtime, status[0], pid));
  8. }
  9. else {
  10. runtime.getCurrentContext().setLastExitStatus(runtime.getNil());
  11. }
  12. return pid;
  13. }

相关文章

POSIX类方法