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( EPERM          ,   1, "Operation not permitted" )
40 __BIONIC_ERRDEF( ENOENT         ,   2, "No such file or directory" )
41 __BIONIC_ERRDEF( ESRCH          ,   3, "No such process" )
42 __BIONIC_ERRDEF( EINTR          ,   4, "Interrupted system call" )
43 __BIONIC_ERRDEF( EIO            ,   5, "I/O error" )
44 __BIONIC_ERRDEF( ENXIO          ,   6, "No such device or address" )
45 __BIONIC_ERRDEF( E2BIG          ,   7, "Argument list too long" )
46 __BIONIC_ERRDEF( ENOEXEC        ,   8, "Exec format error" )
47 __BIONIC_ERRDEF( EBADF          ,   9, "Bad file number" )
48 __BIONIC_ERRDEF( ECHILD         ,  10, "No child processes" )
49 __BIONIC_ERRDEF( EAGAIN         ,  11, "Try again" )
50 __BIONIC_ERRDEF( ENOMEM         ,  12, "Out of memory" )
51 __BIONIC_ERRDEF( EACCES         ,  13, "Permission denied" )
52 __BIONIC_ERRDEF( EFAULT         ,  14, "Bad address" )
53 __BIONIC_ERRDEF( ENOTBLK        ,  15, "Block device required" )
54 __BIONIC_ERRDEF( EBUSY          ,  16, "Device or resource busy" )
55 __BIONIC_ERRDEF( EEXIST         ,  17, "File exists" )
56 __BIONIC_ERRDEF( EXDEV          ,  18, "Cross-device link" )
57 __BIONIC_ERRDEF( ENODEV         ,  19, "No such device" )
58 __BIONIC_ERRDEF( ENOTDIR        ,  20, "Not a directory" )
59 __BIONIC_ERRDEF( EISDIR         ,  21, "Is a directory" )
60 __BIONIC_ERRDEF( EINVAL         ,  22, "Invalid argument" )
61 __BIONIC_ERRDEF( ENFILE         ,  23, "File table overflow" )
62 __BIONIC_ERRDEF( EMFILE         ,  24, "Too many open files" )
63 __BIONIC_ERRDEF( ENOTTY         ,  25, "Not a typewriter" )
64 __BIONIC_ERRDEF( ETXTBSY        ,  26, "Text file busy" )
65 __BIONIC_ERRDEF( EFBIG          ,  27, "File too large" )
66 __BIONIC_ERRDEF( ENOSPC         ,  28, "No space left on device" )
67 __BIONIC_ERRDEF( ESPIPE         ,  29, "Illegal seek" )
68 __BIONIC_ERRDEF( EROFS          ,  30, "Read-only file system" )
69 __BIONIC_ERRDEF( EMLINK         ,  31, "Too many links" )
70 __BIONIC_ERRDEF( EPIPE          ,  32, "Broken pipe" )
71 __BIONIC_ERRDEF( EDOM           ,  33, "Math argument out of domain of func" )
72 __BIONIC_ERRDEF( ERANGE         ,  34, "Math result not representable" )
73 __BIONIC_ERRDEF( EDEADLK        ,  35, "Resource deadlock would occur" )
74 __BIONIC_ERRDEF( ENAMETOOLONG   ,  36, "File name too long" )
75 __BIONIC_ERRDEF( ENOLCK         ,  37, "No record locks available" )
76 __BIONIC_ERRDEF( ENOSYS         ,  38, "Function not implemented" )
77 __BIONIC_ERRDEF( ENOTEMPTY      ,  39, "Directory not empty" )
78 __BIONIC_ERRDEF( ELOOP          ,  40, "Too many symbolic links encountered" )
79 __BIONIC_ERRDEF( ENOMSG         ,  42, "No message of desired type" )
80 __BIONIC_ERRDEF( EIDRM          ,  43, "Identifier removed" )
81 __BIONIC_ERRDEF( ECHRNG         ,  44, "Channel number out of range" )
82 __BIONIC_ERRDEF( EL2NSYNC       ,  45, "Level 2 not synchronized" )
83 __BIONIC_ERRDEF( EL3HLT         ,  46, "Level 3 halted" )
84 __BIONIC_ERRDEF( EL3RST         ,  47, "Level 3 reset" )
85 __BIONIC_ERRDEF( ELNRNG         ,  48, "Link number out of range" )
86 __BIONIC_ERRDEF( EUNATCH        ,  49, "Protocol driver not attached" )
87 __BIONIC_ERRDEF( ENOCSI         ,  50, "No CSI structure available" )
88 __BIONIC_ERRDEF( EL2HLT         ,  51, "Level 2 halted" )
89 __BIONIC_ERRDEF( EBADE          ,  52, "Invalid exchange" )
90 __BIONIC_ERRDEF( EBADR          ,  53, "Invalid request descriptor" )
91 __BIONIC_ERRDEF( EXFULL         ,  54, "Exchange full" )
92 __BIONIC_ERRDEF( ENOANO         ,  55, "No anode" )
93 __BIONIC_ERRDEF( EBADRQC        ,  56, "Invalid request code" )
94 __BIONIC_ERRDEF( EBADSLT        ,  57, "Invalid slot" )
95 __BIONIC_ERRDEF( EBFONT         ,  59, "Bad font file format" )
96 __BIONIC_ERRDEF( ENOSTR         ,  60, "Device not a stream" )
97 __BIONIC_ERRDEF( ENODATA        ,  61, "No data available" )
98 __BIONIC_ERRDEF( ETIME          ,  62, "Timer expired" )
99 __BIONIC_ERRDEF( ENOSR          ,  63, "Out of streams resources" )
100 __BIONIC_ERRDEF( ENONET         ,  64, "Machine is not on the network" )
101 __BIONIC_ERRDEF( ENOPKG         ,  65, "Package not installed" )
102 __BIONIC_ERRDEF( EREMOTE        ,  66, "Object is remote" )
103 __BIONIC_ERRDEF( ENOLINK        ,  67, "Link has been severed" )
104 __BIONIC_ERRDEF( EADV           ,  68, "Advertise error" )
105 __BIONIC_ERRDEF( ESRMNT         ,  69, "Srmount error" )
106 __BIONIC_ERRDEF( ECOMM          ,  70, "Communication error on send" )
107 __BIONIC_ERRDEF( EPROTO         ,  71, "Protocol error" )
108 __BIONIC_ERRDEF( EMULTIHOP      ,  72, "Multihop attempted" )
109 __BIONIC_ERRDEF( EDOTDOT        ,  73, "RFS specific error" )
110 __BIONIC_ERRDEF( EBADMSG        ,  74, "Not a data message" )
111 __BIONIC_ERRDEF( EOVERFLOW      ,  75, "Value too large for defined data type" )
112 __BIONIC_ERRDEF( ENOTUNIQ       ,  76, "Name not unique on network" )
113 __BIONIC_ERRDEF( EBADFD         ,  77, "File descriptor in bad state" )
114 __BIONIC_ERRDEF( EREMCHG        ,  78, "Remote address changed" )
115 __BIONIC_ERRDEF( ELIBACC        ,  79, "Can not access a needed shared library" )
116 __BIONIC_ERRDEF( ELIBBAD        ,  80, "Accessing a corrupted shared library" )
117 __BIONIC_ERRDEF( ELIBSCN        ,  81, ".lib section in a.out corrupted" )
118 __BIONIC_ERRDEF( ELIBMAX        ,  82, "Attempting to link in too many shared libraries" )
119 __BIONIC_ERRDEF( ELIBEXEC       ,  83, "Cannot exec a shared library directly" )
120 __BIONIC_ERRDEF( EILSEQ         ,  84, "Illegal byte sequence" )
121 __BIONIC_ERRDEF( ERESTART       ,  85, "Interrupted system call should be restarted" )
122 __BIONIC_ERRDEF( ESTRPIPE       ,  86, "Streams pipe error" )
123 __BIONIC_ERRDEF( EUSERS         ,  87, "Too many users" )
124 __BIONIC_ERRDEF( ENOTSOCK       ,  88, "Socket operation on non-socket" )
125 __BIONIC_ERRDEF( EDESTADDRREQ   ,  89, "Destination address required" )
126 __BIONIC_ERRDEF( EMSGSIZE       ,  90, "Message too long" )
127 __BIONIC_ERRDEF( EPROTOTYPE     ,  91, "Protocol wrong type for socket" )
128 __BIONIC_ERRDEF( ENOPROTOOPT    ,  92, "Protocol not available" )
129 __BIONIC_ERRDEF( EPROTONOSUPPORT,  93, "Protocol not supported" )
130 __BIONIC_ERRDEF( ESOCKTNOSUPPORT,  94, "Socket type not supported" )
131 __BIONIC_ERRDEF( EOPNOTSUPP     ,  95, "Operation not supported on transport endpoint" )
132 __BIONIC_ERRDEF( EPFNOSUPPORT   ,  96, "Protocol family not supported" )
133 __BIONIC_ERRDEF( EAFNOSUPPORT   ,  97, "Address family not supported by protocol" )
134 __BIONIC_ERRDEF( EADDRINUSE     ,  98, "Address already in use" )
135 __BIONIC_ERRDEF( EADDRNOTAVAIL  ,  99, "Cannot assign requested address" )
136 __BIONIC_ERRDEF( ENETDOWN       , 100, "Network is down" )
137 __BIONIC_ERRDEF( ENETUNREACH    , 101, "Network is unreachable" )
138 __BIONIC_ERRDEF( ENETRESET      , 102, "Network dropped connection because of reset" )
139 __BIONIC_ERRDEF( ECONNABORTED   , 103, "Software caused connection abort" )
140 __BIONIC_ERRDEF( ECONNRESET     , 104, "Connection reset by peer" )
141 __BIONIC_ERRDEF( ENOBUFS        , 105, "No buffer space available" )
142 __BIONIC_ERRDEF( EISCONN        , 106, "Transport endpoint is already connected" )
143 __BIONIC_ERRDEF( ENOTCONN       , 107, "Transport endpoint is not connected" )
144 __BIONIC_ERRDEF( ESHUTDOWN      , 108, "Cannot send after transport endpoint shutdown" )
145 __BIONIC_ERRDEF( ETOOMANYREFS   , 109, "Too many references: cannot splice" )
146 __BIONIC_ERRDEF( ETIMEDOUT      , 110, "Connection timed out" )
147 __BIONIC_ERRDEF( ECONNREFUSED   , 111, "Connection refused" )
148 __BIONIC_ERRDEF( EHOSTDOWN      , 112, "Host is down" )
149 __BIONIC_ERRDEF( EHOSTUNREACH   , 113, "No route to host" )
150 __BIONIC_ERRDEF( EALREADY       , 114, "Operation already in progress" )
151 __BIONIC_ERRDEF( EINPROGRESS    , 115, "Operation now in progress" )
152 __BIONIC_ERRDEF( ESTALE         , 116, "Stale NFS file handle" )
153 __BIONIC_ERRDEF( EUCLEAN        , 117, "Structure needs cleaning" )
154 __BIONIC_ERRDEF( ENOTNAM        , 118, "Not a XENIX named type file" )
155 __BIONIC_ERRDEF( ENAVAIL        , 119, "No XENIX semaphores available" )
156 __BIONIC_ERRDEF( EISNAM         , 120, "Is a named type file" )
157 __BIONIC_ERRDEF( EREMOTEIO      , 121, "Remote I/O error" )
158 __BIONIC_ERRDEF( EDQUOT         , 122, "Quota exceeded" )
159 __BIONIC_ERRDEF( ENOMEDIUM      , 123, "No medium found" )
160 __BIONIC_ERRDEF( EMEDIUMTYPE    , 124, "Wrong medium type" )
161 __BIONIC_ERRDEF( ECANCELED      , 125, "Operation Canceled" )
162 __BIONIC_ERRDEF( ENOKEY         , 126, "Required key not available" )
163 __BIONIC_ERRDEF( EKEYEXPIRED    , 127, "Key has expired" )
164 __BIONIC_ERRDEF( EKEYREVOKED    , 128, "Key has been revoked" )
165 __BIONIC_ERRDEF( EKEYREJECTED   , 129, "Key was rejected by service" )
166 __BIONIC_ERRDEF( EOWNERDEAD     , 130, "Owner died" )
167 __BIONIC_ERRDEF( ENOTRECOVERABLE, 131, "State not recoverable" )
168 
169 /* the following is not defined by Linux but needed for the BSD portions of the C library */
170 __BIONIC_ERRDEF( EFTYPE, 1000, "Stupid C library hack !!" )
171 
172 #undef __BIONIC_ERRDEF
173