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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static int redirectClose(Ruby runtime, ExecArg eargp, int fd, boolean forChild)
{
  if (forChild) {
    eargp.fileActions.add(SpawnFileAction.close(fd));
    return 0;
  } else {
    return runtime.getPosix().close(fd);
  }
}

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

static int redirectClose(Ruby runtime, ExecArg eargp, int fd, boolean forChild)
{
  if (forChild) {
    eargp.fileActions.add(SpawnFileAction.close(fd));
    return 0;
  } else {
    return runtime.getPosix().close(fd);
  }
}

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

SpawnFileAction.dup(stderr[1], 2),
        SpawnFileAction.close(stdin[1]),
        SpawnFileAction.close(stdout[0]),
        SpawnFileAction.close(stderr[0])),
    command,
    envp);
posix.close(stdin[0]);
posix.close(stdout[1]);
posix.close(stderr[1]);

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

public static void close(PyObject fd) {
  Object obj = fd.__tojava__(RawIOBase.class);
  if (obj != Py.NoConversion) {
    ((RawIOBase)obj).close();
  } else {
    posix.close(getFD(fd).getIntFD());
  }
}

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

public static void closerange(PyObject fd_lowObj, PyObject fd_highObj) {
  int fd_low = getFD(fd_lowObj).getIntFD(false);
  int fd_high = getFD(fd_highObj).getIntFD(false);
  for (int i = fd_low; i < fd_high; i++) {
    try {
      posix.close(i);
    } catch (Exception e) {}
  }
}

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

if (API.rb_pipe(runtime, pair) == -1) {
    e = posix.errno;
    runtime.getPosix().close(writePair[1]);
    runtime.getPosix().close(writePair[0]);
    posix.errno = e;
    throw runtime.newErrnoFromErrno(posix.errno, prog.toString());
  execargFixup(context, runtime, eargp);
} catch (RaiseException re) { // if (state)
  if (writePair[0] != -1) runtime.getPosix().close(writePair[0]);
  if (writePair[1] != -1) runtime.getPosix().close(writePair[1]);
  if (pair[0] != -1) runtime.getPosix().close(pair[0]);
  if (pair[1] != -1) runtime.getPosix().close(pair[1]);
  execargParentEnd(runtime, eargp);
  throw re;
runtime.getPosix().close(pair[1]);
runtime.getPosix().close(pair[0]);
if ((fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) == (OpenFile.READABLE|OpenFile.WRITABLE)) {
  runtime.getPosix().close(pair[1]);
  runtime.getPosix().close(pair[0]);
runtime.getPosix().close(pair[1]);
fd = pair[0];
runtime.getPosix().close(writePair[0]);
write_fd = writePair[1];
runtime.getPosix().close(pair[1]);
fd = pair[0];

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

if (API.rb_pipe(runtime, pair) == -1) {
    e = posix.errno;
    runtime.getPosix().close(writePair[1]);
    runtime.getPosix().close(writePair[0]);
    posix.errno = e;
    throw runtime.newErrnoFromErrno(posix.errno, prog.toString());
  execargFixup(context, runtime, eargp);
} catch (RaiseException re) { // if (state)
  if (writePair[0] != -1) runtime.getPosix().close(writePair[0]);
  if (writePair[1] != -1) runtime.getPosix().close(writePair[1]);
  if (pair[0] != -1) runtime.getPosix().close(pair[0]);
  if (pair[1] != -1) runtime.getPosix().close(pair[1]);
  execargParentEnd(runtime, eargp);
  throw re;
runtime.getPosix().close(pair[1]);
runtime.getPosix().close(pair[0]);
if ((fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) == (OpenFile.READABLE|OpenFile.WRITABLE)) {
  runtime.getPosix().close(pair[1]);
  runtime.getPosix().close(pair[0]);
runtime.getPosix().close(pair[1]);
fd = pair[0];
runtime.getPosix().close(writePair[0]);
write_fd = writePair[1];
runtime.getPosix().close(pair[1]);
fd = pair[0];

相关文章

POSIX类方法