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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章

POSIX类方法