RTErrConvertFromErrno.cpp revision a885e5075fe66ed834666941764be11135b5f9b3
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * IPRT - Convert errno to iprt status codes.
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * Copyright (C) 2006-2012 Oracle Corporation
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * This file is part of VirtualBox Open Source Edition (OSE), as
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * available from http://www.virtualbox.org. This file is free software;
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * you can redistribute it and/or modify it under the terms of the GNU
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * General Public License (GPL) as published by the Free Software
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * Foundation, in version 2 as it comes in the "COPYING" file of the
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7bf512aea50c834dc9c3ef5a0a228059fcc753a5jenkins * The contents of this file may alternatively be used under the terms
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * of the Common Development and Distribution License Version 1.0
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * VirtualBox OSE distribution, in which case the provisions of the
5d4589530d1353fdd627ab216a1cdcbcaf6b705ejenkins * CDDL are applicable instead of those of the GPL.
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * You may elect to license modified versions of this file under the
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington * terms and conditions of either the GPL or the CDDL or both.
15f60c5ba586de69e94c6045e9bf91103e924020James Phillpotts/*******************************************************************************
15f60c5ba586de69e94c6045e9bf91103e924020James Phillpotts* Header Files *
15f60c5ba586de69e94c6045e9bf91103e924020James Phillpotts*******************************************************************************/
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill CunningtonRTDECL(int) RTErrConvertFromErrno(unsigned uNativeCode)
9f92250fcac0f79bcde31080a38940cb4ebecda8Phill Cunnington /* very fast check for no error. */
* This switch is arranged like the Linux i386 errno.h! This switch is mirrored
switch (uNativeCode)
#ifdef EPERM
#ifdef ENOENT
#ifdef ESRCH
#ifdef EINTR
#ifdef EIO
#ifdef ENXIO
#ifdef E2BIG
#ifdef ENOEXEC
#ifdef EBADF
#ifdef ECHILD
#ifdef EAGAIN
#ifdef ENOMEM
#ifdef EACCES
#ifdef EFAULT
#ifdef ENOTBLK
#ifdef EBUSY
#ifdef EEXIST
#ifdef EXDEV
#ifdef ENODEV
#ifdef ENOTDIR
#ifdef EISDIR
#ifdef EINVAL
#ifdef ENFILE
#ifdef EMFILE
#ifdef ENOTTY
#ifdef ETXTBSY
#ifdef EFBIG
#ifdef ENOSPC
#ifdef ESPIPE
#ifdef EROFS
#ifdef EMLINK
#ifdef EPIPE
#ifdef EDOM
#ifdef ERANGE
#ifdef EDEADLK
#ifdef ENAMETOOLONG
#ifdef ENOLCK
#ifdef ENOTEMPTY
#ifdef ELOOP
#ifdef ENOMSG
#ifdef EIDRM
#ifdef ECHRNG
#ifdef EL2NSYNC
#ifdef EL3HLT
#ifdef EL3RST
#ifdef ELNRNG
#ifdef EUNATCH
#ifdef ENOCSI
#ifdef EL2HLT
#ifdef EBADE
#ifdef EBADR
#ifdef EXFULL
#ifdef ENOANO
#ifdef EBADRQC
#ifdef EBADSLT
#ifdef EBFONT
#ifdef ENOSTR
#ifdef ENODATA
#ifdef ETIME
#ifdef ENOSR
#ifdef ENONET
#ifdef ENOPKG
#ifdef EREMOTE
#ifdef ENOLINK
#ifdef EADV
#ifdef ESRMNT
#ifdef ECOMM
#ifdef EPROTO
#ifdef EMULTIHOP
#ifdef EDOTDOT
#ifdef EBADMSG
#ifdef EOVERFLOW
#ifdef ENOTUNIQ
#ifdef EBADFD
#ifdef EREMCHG
#ifdef ELIBACC
#ifdef ELIBBAD
#ifdef ELIBSCN
#ifdef ELIBMAX
#ifdef ELIBEXEC
#ifdef EILSEQ
#ifdef ERESTART
#ifdef ESTRPIPE
#ifdef EUSERS
#ifdef ENOTSOCK
#ifdef EDESTADDRREQ
#ifdef EMSGSIZE
#ifdef EPROTOTYPE
#ifdef ENOPROTOOPT
#ifdef EPROTONOSUPPORT
#ifdef ESOCKTNOSUPPORT
#ifdef EPFNOSUPPORT
#ifdef EAFNOSUPPORT
#ifdef EADDRINUSE
#ifdef EADDRNOTAVAIL
#ifdef ENETDOWN
#ifdef ENETUNREACH
#ifdef ENETRESET
#ifdef ECONNABORTED
#ifdef ECONNRESET
#ifdef ENOBUFS
#ifdef EISCONN
#ifdef ENOTCONN
#ifdef ESHUTDOWN
#ifdef ETOOMANYREFS
#ifdef ETIMEDOUT
#ifdef ECONNREFUSED
#ifdef EHOSTDOWN
#ifdef EHOSTUNREACH
#ifdef EALREADY
#ifdef EINPROGRESS
#ifdef ESTALE
#ifdef EUCLEAN
#ifdef ENOTNAM
#ifdef ENAVAIL
#ifdef EISNAM
#ifdef EREMOTEIO
#ifdef EDQUOT
#ifdef ENOMEDIUM
#ifdef EMEDIUMTYPE
#ifdef EPROCLIM
#ifdef EDOOFUS
#ifdef ENOTSUP
# ifndef EOPNOTSUPP
return VERR_UNRESOLVED_ERROR;