public int fcntlInt(int fd, Fcntl fcntlConst, int arg) { try { return posix.fcntlInt(fd, fcntlConst, arg); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int fcntlInt(int fd, Fcntl fcntlConst, int arg) { return posix().fcntlInt(fd, fcntlConst, arg); }
public int fcntlInt(int fd, Fcntl fcntlConst, int arg) { return posix().fcntlInt(fd, fcntlConst, arg); }
public int fcntlInt(int fd, Fcntl fcntlConst, int arg) { return posix().fcntlInt(fd, fcntlConst, arg); }
public int fcntlInt(int fd, Fcntl fcntlConst, int arg) { try { return posix.fcntlInt(fd, fcntlConst, arg); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int fcntlInt(int fd, Fcntl fcntlConst, int arg) { try { return posix.fcntlInt(fd, fcntlConst, arg); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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());
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());
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);
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);