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

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

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

POSIX.close介绍

暂无

代码示例

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

  1. public int close(int fd) {
  2. return posix().close(fd);
  3. }

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

  1. static void parentRedirectClose(Ruby runtime, int fd) {
  2. // close_unless_reserved
  3. if (fd > 2) runtime.getPosix().close(fd);
  4. }

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

  1. static void parentRedirectClose(Ruby runtime, int fd) {
  2. // close_unless_reserved
  3. if (fd > 2) runtime.getPosix().close(fd);
  4. }

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

  1. public int close(int fd) {
  2. try { return posix.close(fd); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int close(int fd) {
  2. try { return posix.close(fd); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int close(int fd) {
  2. try { return posix.close(fd); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); }
  3. }

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

  1. public int close(int fd) {
  2. return posix().close(fd);
  3. }

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

  1. public int close(int fd) {
  2. return posix().close(fd);
  3. }

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

  1. static int redirectClose(Ruby runtime, ExecArg eargp, int fd, boolean forChild)
  2. {
  3. if (forChild) {
  4. eargp.fileActions.add(SpawnFileAction.close(fd));
  5. return 0;
  6. } else {
  7. return runtime.getPosix().close(fd);
  8. }
  9. }

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

  1. static int redirectClose(Ruby runtime, ExecArg eargp, int fd, boolean forChild)
  2. {
  3. if (forChild) {
  4. eargp.fileActions.add(SpawnFileAction.close(fd));
  5. return 0;
  6. } else {
  7. return runtime.getPosix().close(fd);
  8. }
  9. }

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

  1. SpawnFileAction.dup(stderr[1], 2),
  2. SpawnFileAction.close(stdin[1]),
  3. SpawnFileAction.close(stdout[0]),
  4. SpawnFileAction.close(stderr[0])),
  5. command,
  6. envp);
  7. posix.close(stdin[0]);
  8. posix.close(stdout[1]);
  9. posix.close(stderr[1]);

代码示例来源:origin: org.python/jython

  1. public static void close(PyObject fd) {
  2. Object obj = fd.__tojava__(RawIOBase.class);
  3. if (obj != Py.NoConversion) {
  4. ((RawIOBase)obj).close();
  5. } else {
  6. posix.close(getFD(fd).getIntFD());
  7. }
  8. }

代码示例来源:origin: org.python/jython

  1. public static void closerange(PyObject fd_lowObj, PyObject fd_highObj) {
  2. int fd_low = getFD(fd_lowObj).getIntFD(false);
  3. int fd_high = getFD(fd_highObj).getIntFD(false);
  4. for (int i = fd_low; i < fd_high; i++) {
  5. try {
  6. posix.close(i);
  7. } catch (Exception e) {}
  8. }
  9. }

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

  1. if (API.rb_pipe(runtime, pair) == -1) {
  2. e = posix.errno;
  3. runtime.getPosix().close(writePair[1]);
  4. runtime.getPosix().close(writePair[0]);
  5. posix.errno = e;
  6. throw runtime.newErrnoFromErrno(posix.errno, prog.toString());
  7. execargFixup(context, runtime, eargp);
  8. } catch (RaiseException re) { // if (state)
  9. if (writePair[0] != -1) runtime.getPosix().close(writePair[0]);
  10. if (writePair[1] != -1) runtime.getPosix().close(writePair[1]);
  11. if (pair[0] != -1) runtime.getPosix().close(pair[0]);
  12. if (pair[1] != -1) runtime.getPosix().close(pair[1]);
  13. execargParentEnd(runtime, eargp);
  14. throw re;
  15. runtime.getPosix().close(pair[1]);
  16. runtime.getPosix().close(pair[0]);
  17. if ((fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) == (OpenFile.READABLE|OpenFile.WRITABLE)) {
  18. runtime.getPosix().close(pair[1]);
  19. runtime.getPosix().close(pair[0]);
  20. runtime.getPosix().close(pair[1]);
  21. fd = pair[0];
  22. runtime.getPosix().close(writePair[0]);
  23. write_fd = writePair[1];
  24. runtime.getPosix().close(pair[1]);
  25. fd = pair[0];

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

  1. if (API.rb_pipe(runtime, pair) == -1) {
  2. e = posix.errno;
  3. runtime.getPosix().close(writePair[1]);
  4. runtime.getPosix().close(writePair[0]);
  5. posix.errno = e;
  6. throw runtime.newErrnoFromErrno(posix.errno, prog.toString());
  7. execargFixup(context, runtime, eargp);
  8. } catch (RaiseException re) { // if (state)
  9. if (writePair[0] != -1) runtime.getPosix().close(writePair[0]);
  10. if (writePair[1] != -1) runtime.getPosix().close(writePair[1]);
  11. if (pair[0] != -1) runtime.getPosix().close(pair[0]);
  12. if (pair[1] != -1) runtime.getPosix().close(pair[1]);
  13. execargParentEnd(runtime, eargp);
  14. throw re;
  15. runtime.getPosix().close(pair[1]);
  16. runtime.getPosix().close(pair[0]);
  17. if ((fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) == (OpenFile.READABLE|OpenFile.WRITABLE)) {
  18. runtime.getPosix().close(pair[1]);
  19. runtime.getPosix().close(pair[0]);
  20. runtime.getPosix().close(pair[1]);
  21. fd = pair[0];
  22. runtime.getPosix().close(writePair[0]);
  23. write_fd = writePair[1];
  24. runtime.getPosix().close(pair[1]);
  25. fd = pair[0];

相关文章

POSIX类方法