本文整理了Java中jnr.posix.POSIX.fcntl()
方法的一些代码示例,展示了POSIX.fcntl()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。POSIX.fcntl()
方法的具体详情如下:
包路径:jnr.posix.POSIX
类名称:POSIX
方法名:fcntl
[英]fcntl(2)
[中]fcntl(2)
代码示例来源:origin: org.jruby/jruby-complete
public int fcntlGetFD(int fd) {
int ret = posix.fcntl(fd, Fcntl.F_GETFD);
return ret;
}
代码示例来源:origin: org.jruby/jruby-complete
static int redirectCloexecDup(Ruby runtime, int oldfd)
{
int ret = redirectDup(runtime, oldfd);
int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
return ret;
}
代码示例来源:origin: org.jruby/jruby-core
static int redirectCloexecDup(Ruby runtime, int oldfd)
{
int ret = redirectDup(runtime, oldfd);
int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
return ret;
}
代码示例来源:origin: org.jruby/jruby-core
public int fcntlGetFD(int fd) {
int ret = posix.fcntl(fd, Fcntl.F_GETFD);
return ret;
}
代码示例来源:origin: org.jruby/jruby-complete
static int redirectDup(Ruby runtime, int oldfd)
{
// Partial impl of rb_cloexec_fcntl_dup
int ret;
ret = runtime.getPosix().dup(oldfd);
int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
return ret;
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
return posix().fcntl(fd, fcntlConst);
}
代码示例来源:origin: org.jruby/jruby-core
static int redirectDup(Ruby runtime, int oldfd)
{
// Partial impl of rb_cloexec_fcntl_dup
int ret;
ret = runtime.getPosix().dup(oldfd);
int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
return ret;
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
return posix().fcntl(fd, fcntlConst);
}
代码示例来源:origin: org.jruby/jruby-complete
public int setCloexec(int fd, boolean cloexec) {
int ret = posix.fcntl(fd, Fcntl.F_GETFD);
if (ret == -1) {
errno = Errno.valueOf(posix.errno());
return -1;
}
if (
(cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == FcntlLibrary.FD_CLOEXEC)
|| (!cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == 0)) {
return 0;
}
ret = cloexec ?
ret | FcntlLibrary.FD_CLOEXEC :
ret & ~FcntlLibrary.FD_CLOEXEC;
ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
if (ret == -1) errno = Errno.valueOf(posix.errno());
return ret;
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int fcntl(int fd, Fcntl fcntlConst) {
try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: org.jruby/jruby-core
public int setCloexec(int fd, boolean cloexec) {
int ret = posix.fcntl(fd, Fcntl.F_GETFD);
if (ret == -1) {
errno = Errno.valueOf(posix.errno());
return -1;
}
if (
(cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == FcntlLibrary.FD_CLOEXEC)
|| (!cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == 0)) {
return 0;
}
ret = cloexec ?
ret | FcntlLibrary.FD_CLOEXEC :
ret & ~FcntlLibrary.FD_CLOEXEC;
ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
if (ret == -1) errno = Errno.valueOf(posix.errno());
return ret;
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst) {
return posix().fcntl(fd, fcntlConst);
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
return posix().fcntl(fd, fcntlConst);
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst) {
try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int fcntl(int fd, Fcntl fcntlConst) {
return posix().fcntl(fd, fcntlConst);
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: io.prestosql.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst) {
return posix().fcntl(fd, fcntlConst);
}
代码示例来源:origin: com.github.jnr/jnr-posix
public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst) {
try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-driver
public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
}
内容来源于网络,如有侵权,请联系作者删除!