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

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

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

POSIX.dup2介绍

暂无

代码示例

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

public int dup2(int oldFd, int newFd) {
  return posix().dup2(oldFd, newFd);
}

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

public int dup2(int oldFd, int newFd) {
  try { return posix.dup2(oldFd, newFd); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}

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

public int dup2(int oldFd, int newFd) {
  return posix().dup2(oldFd, newFd);
}

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

public int dup2(int oldFd, int newFd) {
  try { return posix.dup2(oldFd, newFd); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}

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

public int dup2(int oldFd, int newFd) {
  try { return posix.dup2(oldFd, newFd); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}

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

public int dup2(int oldFd, int newFd) {
  return posix().dup2(oldFd, newFd);
}

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

public int dup2From(POSIX posix, ChannelFD dup2Source) {
  if (dup2Source.realFileno != -1 && realFileno != -1 && chFile == null) {
    // real file descriptors, so we can dup2 directly
    // ...but FileChannel tracks mode on its own, so we can't dup2 into it
    // TODO: investigate how badly this might damage JVM streams (prediction: not badly)
    return posix.dup2(dup2Source.realFileno, realFileno);
  }
  // TODO: not sure how well this combines native and non-native streams
  // simulate dup2 by forcing filedes's channel into filedes2
  this.ch = dup2Source.ch;
  initFileno();
  initChannelTypes();
  this.refs = dup2Source.refs;
  this.refs.incrementAndGet();
  this.currentLock = dup2Source.currentLock;
  return fakeFileno;
}

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

public int dup2From(POSIX posix, ChannelFD dup2Source) {
  if (dup2Source.realFileno != -1 && realFileno != -1 && chFile == null) {
    // real file descriptors, so we can dup2 directly
    // ...but FileChannel tracks mode on its own, so we can't dup2 into it
    // TODO: investigate how badly this might damage JVM streams (prediction: not badly)
    return posix.dup2(dup2Source.realFileno, realFileno);
  }
  // TODO: not sure how well this combines native and non-native streams
  // simulate dup2 by forcing filedes's channel into filedes2
  this.ch = dup2Source.ch;
  initFileno();
  initChannelTypes();
  this.refs = dup2Source.refs;
  this.refs.incrementAndGet();
  this.currentLock = dup2Source.currentLock;
  return fakeFileno;
}

相关文章

POSIX类方法