Examples of errno()


Examples of jnr.posix.POSIX.errno()

            if (lToDelete.isDirectory() && !isSymlink) {
                throw runtime.newErrnoEPERMError(filename.getUnicodeValue());
            }

            if (posix.unlink(lToDelete.getAbsolutePath()) < 0) {
                throw runtime.newErrnoFromInt(posix.errno());
            }
        }

        return runtime.newFixnum(args.length);
    }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

        boolean locked = fptr.lock();
        try {
            if ((fptr.getMode() & OpenFile.WRITABLE) != 0) {
                if (fptr.io_fflush(context) < 0)
                    throw context.runtime.newErrnoFromErrno(fptr.errno(), "");
                //            #ifdef _WIN32
                //            if (sync && GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) {
                //                rb_thread_io_blocking_region(nogvl_fsync, fptr, fptr->fd);
                //            }
                //            #endif
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

                        //                n = arg.len;
                        n = OpenFile.readInternal(context, fptr, fptr.fd(), strByteList.unsafeBytes(), strByteList.begin(), len);
                        if (n < 0) {
                            if (!nonblock && fptr.waitReadable(context))
                                continue again;
                            if (nonblock && (fptr.errno() == Errno.EWOULDBLOCK || fptr.errno() == Errno.EAGAIN)) {
                                if (noException)
                                    return runtime.newSymbol("wait_readable");
                                else
                                    throw runtime.newErrnoEAGAINReadableError("read would block");
                            }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

                        //                n = arg.len;
                        n = OpenFile.readInternal(context, fptr, fptr.fd(), strByteList.unsafeBytes(), strByteList.begin(), len);
                        if (n < 0) {
                            if (!nonblock && fptr.waitReadable(context))
                                continue again;
                            if (nonblock && (fptr.errno() == Errno.EWOULDBLOCK || fptr.errno() == Errno.EAGAIN)) {
                                if (noException)
                                    return runtime.newSymbol("wait_readable");
                                else
                                    throw runtime.newErrnoEAGAINReadableError("read would block");
                            }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

            str = EncodingUtils.setStrBuf(runtime, str, ilen);
            ByteList strByteList = ((RubyString) str).getByteList();
            n = OpenFile.readInternal(context, fptr, fptr.fd(), strByteList.unsafeBytes(), strByteList.begin(), ilen);

            if (n == -1) {
                throw runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
            }
        } finally {
            if (locked) fptr.unlock();
        }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

                while (fptr.rbuf.len > 0) {
                    byte[] pBytes = fptr.rbuf.ptr;
                    int p = fptr.rbuf.off++;
                    fptr.rbuf.len--;
                    block.yield(context, runtime.newFixnum(pBytes[p] & 0xFF));
                    fptr.errno(null);
                }
                fptr.checkByteReadable(context);
                fptr.READ_CHECK(context);
            } while (fptr.fillbuf(context) >= 0);
        } finally {
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

        OpenFile fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            long pos = fptr.tell(context);
            if (pos < 0 && fptr.errno() != null) throw context.runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
            pos -= fptr.rbuf.len;
            return context.runtime.newFixnum(pos);
        } finally {
            if (locked) fptr.unlock();
        }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

        OpenFile fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            long pos = fptr.tell(context);
            if (pos < 0 && fptr.errno() != null) throw context.runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
            pos -= fptr.rbuf.len;
            return context.runtime.newFixnum(pos);
        } finally {
            if (locked) fptr.unlock();
        }
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

        fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            pos = fptr.seek(context, pos, PosixShim.SEEK_SET);
            if (pos < 0 && fptr.errno() != null) throw context.runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
        } finally {
            if (locked) fptr.unlock();
        }

        return context.runtime.newFixnum(pos);
View Full Code Here

Examples of org.jruby.util.io.OpenFile.errno()

        fptr = getOpenFileChecked();

        boolean locked = fptr.lock();
        try {
            pos = fptr.seek(context, pos, PosixShim.SEEK_SET);
            if (pos < 0 && fptr.errno() != null) throw context.runtime.newErrnoFromErrno(fptr.errno(), fptr.getPath());
        } finally {
            if (locked) fptr.unlock();
        }

        return context.runtime.newFixnum(pos);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.