Package jnr.constants.platform

Examples of jnr.constants.platform.Errno


                ? new IntByReference(-1) : new LongLongByReference(-1);
        Pointer nativeFileActions = nativeFileActions(fileActions);

        try {
            if (((UnixLibC) libc()).posix_spawnp(pid, path, nativeFileActions, null, argv, envp) < 0) {
                Errno e = Errno.valueOf(errno());
                handler.error(e, "posix_spawnp", e.description());
            }
        } finally {
            ((UnixLibC) libc()).posix_spawn_file_actions_destroy(nativeFileActions);
        }
View Full Code Here


        return child.getPid();
    }

    private static Errno mapErrorToErrno(int error) {
        Errno errno = errorToErrnoMapper.get(error);
        if (errno == null) {
            errno = __UNKNOWN_CONSTANT__;
        }
        return errno;
    }
View Full Code Here

        return child.getPid();
    }

    private static Errno mapErrorToErrno(int error) {
        Errno errno = errorToErrnoMapper.get(error);
        if (errno == null) {
            errno = __UNKNOWN_CONSTANT__;
        }
        return errno;
    }
View Full Code Here

        remoteAddress = remote;
    }

    private final boolean doConnect(SockAddrUnix remote) throws IOException {
        if (Native.connect(getFD(), remote, remote.length()) != 0) {
            Errno error = Errno.valueOf(LastError.getLastError(jnr.ffi.Runtime.getSystemRuntime()));

            switch (error) {
                case EAGAIN:
                case EWOULDBLOCK:
                    return false;

                default:
                    throw new IOException(error.toString());
            }
        }
        return true;
    }
View Full Code Here

        return child.getPid();
    }

    private static Errno mapErrorToErrno(int error) {
        Errno errno = errorToErrnoMapper.get(error);
        if (errno == null) {
            errno = __UNKNOWN_CONSTANT__;
        }
        return errno;
    }
View Full Code Here

        return child.getPid();
    }

    private static Errno mapErrorToErrno(int error) {
        Errno errno = errorToErrnoMapper.get(error);
        if (errno == null) {
            errno = __UNKNOWN_CONSTANT__;
        }
        return errno;
    }
View Full Code Here

        IntByReference pid = new IntByReference(-1);
        Pointer nativeFileActions = nativeFileActions(fileActions);

        try {
            if (libc().posix_spawnp(pid, path, nativeFileActions, null, argv, envp) < 0) {
                Errno e = Errno.valueOf(errno());
                handler.error(e, e.description());
            }
        } finally {
            libc.posix_spawn_file_actions_destroy(nativeFileActions);
        }
View Full Code Here

            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);
    }
View Full Code Here

        }
        return newErrnoFromInt(errno.intValue(), 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);
    }
View Full Code Here

    public static void checkErrno(Ruby runtime, int result) {
        if (result < 0) {
        // FIXME: The error message is a bit off.
        // e.g., No such process - No such process (Errno::ESRCH)
        // Note the repetition of 'No such process'.
            Errno errno = Errno.valueOf(runtime.getPosix().errno());
            String name = errno.name();
            String msg  = errno.toString();
            RubyClass errnoClass = runtime.getErrno().getClass(name);
            if (errnoClass != null) {
                throw new RaiseException(runtime, errnoClass, msg, true);
            }
        }
View Full Code Here

TOP

Related Classes of jnr.constants.platform.Errno

Copyright © 2018 www.massapicom. 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.