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

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

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

POSIX.isNative介绍

暂无

代码示例

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

public boolean isNative() {
  return posix().isNative();
}

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

public boolean isNative() {
  return posix().isNative();
}

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

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;
}

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

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;
}

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

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;
}

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

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;
}

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

@JRubyMethod(meta = true, name = "native_posix?")
public static IRubyObject native_posix_p(ThreadContext context, IRubyObject self) {
  return context.runtime.newBoolean(context.runtime.getPosix().isNative());
}

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

@JRubyMethod(meta = true, name = "native_posix?")
public static IRubyObject native_posix_p(ThreadContext context, IRubyObject self) {
  return context.runtime.newBoolean(context.runtime.getPosix().isNative());
}

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

@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));
}

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

@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));
}

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

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;
}

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

@JRubyMethod(name = "sticky?")
public IRubyObject sticky_p() {
  Ruby runtime = getRuntime();
  
  if (runtime.getPosix().isNative()) {
    return runtime.newBoolean(stat.isSticky());
  }
  
  return runtime.getNil();
}

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

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;
}

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

@JRubyMethod(name = "sticky?")
public IRubyObject sticky_p() {
  Ruby runtime = getRuntime();
  
  if (runtime.getPosix().isNative()) {
    return runtime.newBoolean(stat.isSticky());
  }
  
  return runtime.getNil();
}

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

@JRubyMethod(name = "sticky?")
public IRubyObject sticky_p() {
  checkInitialized();
  Ruby runtime = getRuntime();
  
  if (runtime.getPosix().isNative()) {
    return runtime.newBoolean(stat.isSticky());
  }
  
  return runtime.getNil();
}

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

@JRubyMethod(name = "sticky?")
public IRubyObject sticky_p() {
  checkInitialized();
  Ruby runtime = getRuntime();
  
  if (runtime.getPosix().isNative()) {
    return runtime.newBoolean(stat.isSticky());
  }
  
  return runtime.getNil();
}

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

@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);
  }
}

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

@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);
  }
}

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

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()));
}

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

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()));
}

相关文章

POSIX类方法