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

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

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

POSIX.fcntlInt介绍

暂无

代码示例

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

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

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

public int fcntlInt(int fd, Fcntl fcntlConst, int arg) {
  return posix().fcntlInt(fd, fcntlConst, arg);
}

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

public int fcntlInt(int fd, Fcntl fcntlConst, int arg) {
  return posix().fcntlInt(fd, fcntlConst, arg);
}

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

public int fcntlInt(int fd, Fcntl fcntlConst, int arg) {
  return posix().fcntlInt(fd, fcntlConst, arg);
}

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

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

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

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

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

public int fcntlSetFD(int fd, int flags) {
  int ret = posix.fcntlInt(fd, Fcntl.F_SETFD, flags);
  if (ret == -1) errno = Errno.valueOf(posix.errno());
  return ret;
}

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

public int fcntlSetFD(int fd, int flags) {
  int ret = posix.fcntlInt(fd, Fcntl.F_SETFD, flags);
  if (ret == -1) errno = Errno.valueOf(posix.errno());
  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

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: 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: org.jruby/jruby-complete

protected static ChannelFD newChannelFD(Ruby runtime, Channel channel) {
  ChannelFD fd = new ChannelFD(channel, runtime.getPosix(), runtime.getFilenoUtil());
  if (runtime.getPosix().isNative() && fd.realFileno >= 0 && !Platform.IS_WINDOWS) {
    runtime.getPosix().fcntlInt(fd.realFileno, Fcntl.F_SETFD, FcntlLibrary.FD_CLOEXEC);
  }
  return fd;
}

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

protected static ChannelFD newChannelFD(Ruby runtime, Channel channel) {
  ChannelFD fd = new ChannelFD(channel, runtime.getPosix(), runtime.getFilenoUtil());
  if (runtime.getPosix().isNative() && fd.realFileno >= 0 && !Platform.IS_WINDOWS) {
    runtime.getPosix().fcntlInt(fd.realFileno, Fcntl.F_SETFD, FcntlLibrary.FD_CLOEXEC);
  }
  return fd;
}

代码示例来源: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: 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: org.jruby/jruby-complete

if ((ret & FD_CLOEXEC) != flag) {
    ret = (ret & ~FD_CLOEXEC) | flag;
    ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
    if (ret == -1) API.rb_sys_fail_path(runtime, fptr.getPath());
if ((ret & FD_CLOEXEC) != flag) {
  ret = (ret & ~FD_CLOEXEC) | flag;
  ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
  if (ret == -1) API.rb_sys_fail_path(runtime, fptr.getPath());

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

if ((ret & FD_CLOEXEC) != flag) {
    ret = (ret & ~FD_CLOEXEC) | flag;
    ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
    if (ret == -1) API.rb_sys_fail_path(runtime, fptr.getPath());
if ((ret & FD_CLOEXEC) != flag) {
  ret = (ret & ~FD_CLOEXEC) | flag;
  ret = posix.fcntlInt(fd, Fcntl.F_SETFD, ret);
  if (ret == -1) API.rb_sys_fail_path(runtime, fptr.getPath());

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

int fd = posix.open(absolutePath(), modeFlags.getFlags(), perm);
if (fd < 0) throwFromErrno(posix.errno());
posix.fcntlInt(fd, Fcntl.F_SETFD, posix.fcntl(fd, Fcntl.F_GETFD) | FcntlLibrary.FD_CLOEXEC);
return new NativeDeviceChannel(fd, true);

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

int fd = posix.open(absolutePath(), modeFlags.getFlags(), perm);
if (fd < 0) throwFromErrno(posix.errno());
posix.fcntlInt(fd, Fcntl.F_SETFD, posix.fcntl(fd, Fcntl.F_GETFD) | FcntlLibrary.FD_CLOEXEC);
return new NativeDeviceChannel(fd, true);

相关文章

POSIX类方法