public static IRubyObject rb_sys_fail_path(Ruby runtime, String path) { throw runtime.newSystemCallError("bad path for cloexec: " + path); }
public static IRubyObject rb_sys_fail_path(Ruby runtime, String path) { throw runtime.newSystemCallError("bad path for cloexec: " + path); }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
public RaiseException newErrnoFromErrno(Errno errno, String message) { if (errno == null || errno == Errno.__UNKNOWN_CONSTANT__) { return newSystemCallError(message); } return newErrnoFromInt(errno.intValue(), message); }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
public RaiseException newErrnoFromErrno(Errno errno, String message) { if (errno == null || errno == Errno.__UNKNOWN_CONSTANT__) { return newSystemCallError(message); } return newErrnoFromInt(errno.intValue(), message); }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
public RaiseException newErrnoFromInt(int errno, String message) { RubyClass errnoClass = getErrno(errno); if (errnoClass != null) { return newRaiseException(errnoClass, message); } else { return newSystemCallError("Unknown Error (" + errno + ") - " + message); } }
public RaiseException newErrnoFromInt(int errno) { Errno errnoObj = Errno.valueOf(errno); if (errnoObj == null) { return newSystemCallError("Unknown Error (" + errno + ")"); } String message = errnoObj.description(); return newErrnoFromInt(errno, message); }
public RaiseException newErrnoFromInt(int errno) { Errno errnoObj = Errno.valueOf(errno); if (errnoObj == null) { return newSystemCallError("Unknown Error (" + errno + ")"); } String message = errnoObj.description(); return newErrnoFromInt(errno, message); }
public RaiseException newErrnoFromInt(int errno) { Errno errnoObj = Errno.valueOf(errno); if (errnoObj == null) { return newSystemCallError("Unknown Error (" + errno + ")"); } String message = errnoObj.description(); return newErrnoFromInt(errno, message); }
public RaiseException newErrnoFromInt(int errno) { Errno errnoObj = Errno.valueOf(errno); if (errnoObj == null) { return newSystemCallError("Unknown Error (" + errno + ")"); } String message = errnoObj.description(); return newErrnoFromInt(errno, message); }
protected static ChannelFD sysopen(Ruby runtime, String fname, int oflags, int perm) { ChannelFD fd; Sysopen data = new Sysopen(); data.fname = fname; data.oflags = oflags; data.perm = perm; fd = sysopenInternal(runtime, data); if (fd == null) { if (data.errno != null) { throw runtime.newErrnoFromErrno(data.errno, fname); } else { throw runtime.newSystemCallError(fname); } } return fd; }
protected static ChannelFD sysopen(Ruby runtime, String fname, int oflags, int perm) { ChannelFD fd; Sysopen data = new Sysopen(); data.fname = fname; data.oflags = oflags; data.perm = perm; fd = sysopenInternal(runtime, data); if (fd == null) { if (data.errno != null) { throw runtime.newErrnoFromErrno(data.errno, fname); } else { throw runtime.newSystemCallError(fname); } } return fd; }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
protected static void rb_sys_fail(Ruby runtime, String message) { final int n = LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()); RubyClass instance = runtime.getErrno(n); if(instance == null) { throw runtime.newSystemCallError(message); } else { throw runtime.newErrnoFromInt(n, message); } }
@JRubyMethod public RubyFixnum fsync(ThreadContext context) { Ruby runtime = context.runtime; OpenFile fptr; RubyIO io = GetWriteIO(); fptr = io.getOpenFileChecked(); if (fptr.io_fflush(context) < 0) throw runtime.newSystemCallError(""); if (!Platform.IS_WINDOWS) { /* already called in io_fflush() */ try { if (fptr.fileChannel() != null) fptr.fileChannel().force(true); if (fptr.fd().chNative != null) { int ret = runtime.getPosix().fsync(fptr.fd().chNative.getFD()); if (ret < 0) throw runtime.newErrnoFromInt(runtime.getPosix().errno()); } } catch (IOException ioe) { throw runtime.newIOErrorFromException(ioe); } } return RubyFixnum.zero(runtime); }
@JRubyMethod public RubyFixnum fsync(ThreadContext context) { Ruby runtime = context.runtime; OpenFile fptr; RubyIO io = GetWriteIO(); fptr = io.getOpenFileChecked(); if (fptr.io_fflush(context) < 0) throw runtime.newSystemCallError(""); if (!Platform.IS_WINDOWS) { /* already called in io_fflush() */ try { if (fptr.fileChannel() != null) fptr.fileChannel().force(true); if (fptr.fd().chNative != null) { int ret = runtime.getPosix().fsync(fptr.fd().chNative.getFD()); if (ret < 0) throw runtime.newErrnoFromInt(runtime.getPosix().errno()); } } catch (IOException ioe) { throw runtime.newIOErrorFromException(ioe); } } return RubyFixnum.zero(runtime); }