本文整理了Java中jnr.posix.POSIX.dup2()
方法的一些代码示例,展示了POSIX.dup2()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POSIX.dup2()
方法的具体详情如下:
包路径:jnr.posix.POSIX
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!