Home | History | Annotate | Download | only in sys
      1 /*
      2  * Copyright (C) 2008 The Android Open Source Project
      3  * All rights reserved.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  *  * Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  *  * Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in
     12  *    the documentation and/or other materials provided with the
     13  *    distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     18  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     19  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     21  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
     22  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     23  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     24  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     25  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  * SUCH DAMAGE.
     27  */
     28 
     29 /* the following corresponds to the error codes of the Linux kernel used by the Android platform
     30  * these are distinct from the OpenBSD ones, which is why we need to redeclare them here
     31  *
     32  * this file may be included several times to define either error constants or their
     33  * string representation
     34  */
     35 
     36 #ifndef __BIONIC_ERRDEF
     37 #error "__BIONIC_ERRDEF must be defined before including this file"
     38 #endif
     39 __BIONIC_ERRDEF( 0              ,   0, "Success" )
     40 __BIONIC_ERRDEF( EPERM          ,   1, "Operation not permitted" )
     41 __BIONIC_ERRDEF( ENOENT         ,   2, "No such file or directory" )
     42 __BIONIC_ERRDEF( ESRCH          ,   3, "No such process" )
     43 __BIONIC_ERRDEF( EINTR          ,   4, "Interrupted system call" )
     44 __BIONIC_ERRDEF( EIO            ,   5, "I/O error" )
     45 __BIONIC_ERRDEF( ENXIO          ,   6, "No such device or address" )
     46 __BIONIC_ERRDEF( E2BIG          ,   7, "Argument list too long" )
     47 __BIONIC_ERRDEF( ENOEXEC        ,   8, "Exec format error" )
     48 __BIONIC_ERRDEF( EBADF          ,   9, "Bad file descriptor" )
     49 __BIONIC_ERRDEF( ECHILD         ,  10, "No child processes" )
     50 __BIONIC_ERRDEF( EAGAIN         ,  11, "Try again" )
     51 __BIONIC_ERRDEF( ENOMEM         ,  12, "Out of memory" )
     52 __BIONIC_ERRDEF( EACCES         ,  13, "Permission denied" )
     53 __BIONIC_ERRDEF( EFAULT         ,  14, "Bad address" )
     54 __BIONIC_ERRDEF( ENOTBLK        ,  15, "Block device required" )
     55 __BIONIC_ERRDEF( EBUSY          ,  16, "Device or resource busy" )
     56 __BIONIC_ERRDEF( EEXIST         ,  17, "File exists" )
     57 __BIONIC_ERRDEF( EXDEV          ,  18, "Cross-device link" )
     58 __BIONIC_ERRDEF( ENODEV         ,  19, "No such device" )
     59 __BIONIC_ERRDEF( ENOTDIR        ,  20, "Not a directory" )
     60 __BIONIC_ERRDEF( EISDIR         ,  21, "Is a directory" )
     61 __BIONIC_ERRDEF( EINVAL         ,  22, "Invalid argument" )
     62 __BIONIC_ERRDEF( ENFILE         ,  23, "File table overflow" )
     63 __BIONIC_ERRDEF( EMFILE         ,  24, "Too many open files" )
     64 __BIONIC_ERRDEF( ENOTTY         ,  25, "Not a typewriter" )
     65 __BIONIC_ERRDEF( ETXTBSY        ,  26, "Text file busy" )
     66 __BIONIC_ERRDEF( EFBIG          ,  27, "File too large" )
     67 __BIONIC_ERRDEF( ENOSPC         ,  28, "No space left on device" )
     68 __BIONIC_ERRDEF( ESPIPE         ,  29, "Illegal seek" )
     69 __BIONIC_ERRDEF( EROFS          ,  30, "Read-only file system" )
     70 __BIONIC_ERRDEF( EMLINK         ,  31, "Too many links" )
     71 __BIONIC_ERRDEF( EPIPE          ,  32, "Broken pipe" )
     72 __BIONIC_ERRDEF( EDOM           ,  33, "Math argument out of domain of func" )
     73 __BIONIC_ERRDEF( ERANGE         ,  34, "Math result not representable" )
     74 __BIONIC_ERRDEF( EDEADLK        ,  35, "Resource deadlock would occur" )
     75 __BIONIC_ERRDEF( ENAMETOOLONG   ,  36, "File name too long" )
     76 __BIONIC_ERRDEF( ENOLCK         ,  37, "No record locks available" )
     77 __BIONIC_ERRDEF( ENOSYS         ,  38, "Function not implemented" )
     78 __BIONIC_ERRDEF( ENOTEMPTY      ,  39, "Directory not empty" )
     79 __BIONIC_ERRDEF( ELOOP          ,  40, "Too many symbolic links encountered" )
     80 __BIONIC_ERRDEF( ENOMSG         ,  42, "No message of desired type" )
     81 __BIONIC_ERRDEF( EIDRM          ,  43, "Identifier removed" )
     82 __BIONIC_ERRDEF( ECHRNG         ,  44, "Channel number out of range" )
     83 __BIONIC_ERRDEF( EL2NSYNC       ,  45, "Level 2 not synchronized" )
     84 __BIONIC_ERRDEF( EL3HLT         ,  46, "Level 3 halted" )
     85 __BIONIC_ERRDEF( EL3RST         ,  47, "Level 3 reset" )
     86 __BIONIC_ERRDEF( ELNRNG         ,  48, "Link number out of range" )
     87 __BIONIC_ERRDEF( EUNATCH        ,  49, "Protocol driver not attached" )
     88 __BIONIC_ERRDEF( ENOCSI         ,  50, "No CSI structure available" )
     89 __BIONIC_ERRDEF( EL2HLT         ,  51, "Level 2 halted" )
     90 __BIONIC_ERRDEF( EBADE          ,  52, "Invalid exchange" )
     91 __BIONIC_ERRDEF( EBADR          ,  53, "Invalid request descriptor" )
     92 __BIONIC_ERRDEF( EXFULL         ,  54, "Exchange full" )
     93 __BIONIC_ERRDEF( ENOANO         ,  55, "No anode" )
     94 __BIONIC_ERRDEF( EBADRQC        ,  56, "Invalid request code" )
     95 __BIONIC_ERRDEF( EBADSLT        ,  57, "Invalid slot" )
     96 __BIONIC_ERRDEF( EBFONT         ,  59, "Bad font file format" )
     97 __BIONIC_ERRDEF( ENOSTR         ,  60, "Device not a stream" )
     98 __BIONIC_ERRDEF( ENODATA        ,  61, "No data available" )
     99 __BIONIC_ERRDEF( ETIME          ,  62, "Timer expired" )
    100 __BIONIC_ERRDEF( ENOSR          ,  63, "Out of streams resources" )
    101 __BIONIC_ERRDEF( ENONET         ,  64, "Machine is not on the network" )
    102 __BIONIC_ERRDEF( ENOPKG         ,  65, "Package not installed" )
    103 __BIONIC_ERRDEF( EREMOTE        ,  66, "Object is remote" )
    104 __BIONIC_ERRDEF( ENOLINK        ,  67, "Link has been severed" )
    105 __BIONIC_ERRDEF( EADV           ,  68, "Advertise error" )
    106 __BIONIC_ERRDEF( ESRMNT         ,  69, "Srmount error" )
    107 __BIONIC_ERRDEF( ECOMM          ,  70, "Communication error on send" )
    108 __BIONIC_ERRDEF( EPROTO         ,  71, "Protocol error" )
    109 __BIONIC_ERRDEF( EMULTIHOP      ,  72, "Multihop attempted" )
    110 __BIONIC_ERRDEF( EDOTDOT        ,  73, "RFS specific error" )
    111 __BIONIC_ERRDEF( EBADMSG        ,  74, "Not a data message" )
    112 __BIONIC_ERRDEF( EOVERFLOW      ,  75, "Value too large for defined data type" )
    113 __BIONIC_ERRDEF( ENOTUNIQ       ,  76, "Name not unique on network" )
    114 __BIONIC_ERRDEF( EBADFD         ,  77, "File descriptor in bad state" )
    115 __BIONIC_ERRDEF( EREMCHG        ,  78, "Remote address changed" )
    116 __BIONIC_ERRDEF( ELIBACC        ,  79, "Can not access a needed shared library" )
    117 __BIONIC_ERRDEF( ELIBBAD        ,  80, "Accessing a corrupted shared library" )
    118 __BIONIC_ERRDEF( ELIBSCN        ,  81, ".lib section in a.out corrupted" )
    119 __BIONIC_ERRDEF( ELIBMAX        ,  82, "Attempting to link in too many shared libraries" )
    120 __BIONIC_ERRDEF( ELIBEXEC       ,  83, "Cannot exec a shared library directly" )
    121 __BIONIC_ERRDEF( EILSEQ         ,  84, "Illegal byte sequence" )
    122 __BIONIC_ERRDEF( ERESTART       ,  85, "Interrupted system call should be restarted" )
    123 __BIONIC_ERRDEF( ESTRPIPE       ,  86, "Streams pipe error" )
    124 __BIONIC_ERRDEF( EUSERS         ,  87, "Too many users" )
    125 __BIONIC_ERRDEF( ENOTSOCK       ,  88, "Socket operation on non-socket" )
    126 __BIONIC_ERRDEF( EDESTADDRREQ   ,  89, "Destination address required" )
    127 __BIONIC_ERRDEF( EMSGSIZE       ,  90, "Message too long" )
    128 __BIONIC_ERRDEF( EPROTOTYPE     ,  91, "Protocol wrong type for socket" )
    129 __BIONIC_ERRDEF( ENOPROTOOPT    ,  92, "Protocol not available" )
    130 __BIONIC_ERRDEF( EPROTONOSUPPORT,  93, "Protocol not supported" )
    131 __BIONIC_ERRDEF( ESOCKTNOSUPPORT,  94, "Socket type not supported" )
    132 __BIONIC_ERRDEF( EOPNOTSUPP     ,  95, "Operation not supported on transport endpoint" )
    133 __BIONIC_ERRDEF( EPFNOSUPPORT   ,  96, "Protocol family not supported" )
    134 __BIONIC_ERRDEF( EAFNOSUPPORT   ,  97, "Address family not supported by protocol" )
    135 __BIONIC_ERRDEF( EADDRINUSE     ,  98, "Address already in use" )
    136 __BIONIC_ERRDEF( EADDRNOTAVAIL  ,  99, "Cannot assign requested address" )
    137 __BIONIC_ERRDEF( ENETDOWN       , 100, "Network is down" )
    138 __BIONIC_ERRDEF( ENETUNREACH    , 101, "Network is unreachable" )
    139 __BIONIC_ERRDEF( ENETRESET      , 102, "Network dropped connection because of reset" )
    140 __BIONIC_ERRDEF( ECONNABORTED   , 103, "Software caused connection abort" )
    141 __BIONIC_ERRDEF( ECONNRESET     , 104, "Connection reset by peer" )
    142 __BIONIC_ERRDEF( ENOBUFS        , 105, "No buffer space available" )
    143 __BIONIC_ERRDEF( EISCONN        , 106, "Transport endpoint is already connected" )
    144 __BIONIC_ERRDEF( ENOTCONN       , 107, "Transport endpoint is not connected" )
    145 __BIONIC_ERRDEF( ESHUTDOWN      , 108, "Cannot send after transport endpoint shutdown" )
    146 __BIONIC_ERRDEF( ETOOMANYREFS   , 109, "Too many references: cannot splice" )
    147 __BIONIC_ERRDEF( ETIMEDOUT      , 110, "Connection timed out" )
    148 __BIONIC_ERRDEF( ECONNREFUSED   , 111, "Connection refused" )
    149 __BIONIC_ERRDEF( EHOSTDOWN      , 112, "Host is down" )
    150 __BIONIC_ERRDEF( EHOSTUNREACH   , 113, "No route to host" )
    151 __BIONIC_ERRDEF( EALREADY       , 114, "Operation already in progress" )
    152 __BIONIC_ERRDEF( EINPROGRESS    , 115, "Operation now in progress" )
    153 __BIONIC_ERRDEF( ESTALE         , 116, "Stale NFS file handle" )
    154 __BIONIC_ERRDEF( EUCLEAN        , 117, "Structure needs cleaning" )
    155 __BIONIC_ERRDEF( ENOTNAM        , 118, "Not a XENIX named type file" )
    156 __BIONIC_ERRDEF( ENAVAIL        , 119, "No XENIX semaphores available" )
    157 __BIONIC_ERRDEF( EISNAM         , 120, "Is a named type file" )
    158 __BIONIC_ERRDEF( EREMOTEIO      , 121, "Remote I/O error" )
    159 __BIONIC_ERRDEF( EDQUOT         , 122, "Quota exceeded" )
    160 __BIONIC_ERRDEF( ENOMEDIUM      , 123, "No medium found" )
    161 __BIONIC_ERRDEF( EMEDIUMTYPE    , 124, "Wrong medium type" )
    162 __BIONIC_ERRDEF( ECANCELED      , 125, "Operation Canceled" )
    163 __BIONIC_ERRDEF( ENOKEY         , 126, "Required key not available" )
    164 __BIONIC_ERRDEF( EKEYEXPIRED    , 127, "Key has expired" )
    165 __BIONIC_ERRDEF( EKEYREVOKED    , 128, "Key has been revoked" )
    166 __BIONIC_ERRDEF( EKEYREJECTED   , 129, "Key was rejected by service" )
    167 __BIONIC_ERRDEF( EOWNERDEAD     , 130, "Owner died" )
    168 __BIONIC_ERRDEF( ENOTRECOVERABLE, 131, "State not recoverable" )
    169 
    170 #undef __BIONIC_ERRDEF
    171