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

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

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

POSIX.fcntl介绍

[英]fcntl(2)
[中]fcntl(2)

代码示例

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

  1. public int fcntlGetFD(int fd) {
  2. int ret = posix.fcntl(fd, Fcntl.F_GETFD);
  3. return ret;
  4. }

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

  1. static int redirectCloexecDup(Ruby runtime, int oldfd)
  2. {
  3. int ret = redirectDup(runtime, oldfd);
  4. int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
  5. runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
  6. return ret;
  7. }

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

  1. static int redirectCloexecDup(Ruby runtime, int oldfd)
  2. {
  3. int ret = redirectDup(runtime, oldfd);
  4. int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
  5. runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
  6. return ret;
  7. }

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

  1. public int fcntlGetFD(int fd) {
  2. int ret = posix.fcntl(fd, Fcntl.F_GETFD);
  3. return ret;
  4. }

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

  1. static int redirectDup(Ruby runtime, int oldfd)
  2. {
  3. // Partial impl of rb_cloexec_fcntl_dup
  4. int ret;
  5. ret = runtime.getPosix().dup(oldfd);
  6. int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
  7. runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
  8. return ret;
  9. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
  2. return posix().fcntl(fd, fcntlConst);
  3. }

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

  1. static int redirectDup(Ruby runtime, int oldfd)
  2. {
  3. // Partial impl of rb_cloexec_fcntl_dup
  4. int ret;
  5. ret = runtime.getPosix().dup(oldfd);
  6. int flags = runtime.getPosix().fcntl(ret, Fcntl.F_GETFD);
  7. runtime.getPosix().fcntlInt(ret, Fcntl.F_SETFD, flags | FcntlLibrary.FD_CLOEXEC);
  8. return ret;
  9. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
  2. return posix().fcntl(fd, fcntlConst);
  3. }

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

  1. public int setCloexec(int fd, boolean cloexec) {
  2. int ret = posix.fcntl(fd, Fcntl.F_GETFD);
  3. if (ret == -1) {
  4. errno = Errno.valueOf(posix.errno());
  5. return -1;
  6. }
  7. if (
  8. (cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == FcntlLibrary.FD_CLOEXEC)
  9. || (!cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == 0)) {
  10. return 0;
  11. }
  12. ret = cloexec ?
  13. ret | FcntlLibrary.FD_CLOEXEC :
  14. ret & ~FcntlLibrary.FD_CLOEXEC;
  15. ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
  16. if (ret == -1) errno = Errno.valueOf(posix.errno());
  17. return ret;
  18. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst) {
  2. try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int setCloexec(int fd, boolean cloexec) {
  2. int ret = posix.fcntl(fd, Fcntl.F_GETFD);
  3. if (ret == -1) {
  4. errno = Errno.valueOf(posix.errno());
  5. return -1;
  6. }
  7. if (
  8. (cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == FcntlLibrary.FD_CLOEXEC)
  9. || (!cloexec && (ret & FcntlLibrary.FD_CLOEXEC) == 0)) {
  10. return 0;
  11. }
  12. ret = cloexec ?
  13. ret | FcntlLibrary.FD_CLOEXEC :
  14. ret & ~FcntlLibrary.FD_CLOEXEC;
  15. ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
  16. if (ret == -1) errno = Errno.valueOf(posix.errno());
  17. return ret;
  18. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst) {
  2. return posix().fcntl(fd, fcntlConst);
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
  2. return posix().fcntl(fd, fcntlConst);
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst) {
  2. try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst) {
  2. return posix().fcntl(fd, fcntlConst);
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
  2. try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst) {
  2. return posix().fcntl(fd, fcntlConst);
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
  2. try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst) {
  2. try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int fcntl(int fd, Fcntl fcntlConst, int... arg) {
  2. try { return posix.fcntl(fd, fcntlConst); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

相关文章

POSIX类方法