17a0a89d2SRobert Watson /*- 27a0a89d2SRobert Watson * Copyright (c) 2008 Apple Inc. 37a0a89d2SRobert Watson * All rights reserved. 47a0a89d2SRobert Watson * 57a0a89d2SRobert Watson * Redistribution and use in source and binary forms, with or without 67a0a89d2SRobert Watson * modification, are permitted provided that the following conditions 77a0a89d2SRobert Watson * are met: 87a0a89d2SRobert Watson * 1. Redistributions of source code must retain the above copyright 97a0a89d2SRobert Watson * notice, this list of conditions and the following disclaimer. 107a0a89d2SRobert Watson * 2. Redistributions in binary form must reproduce the above copyright 117a0a89d2SRobert Watson * notice, this list of conditions and the following disclaimer in the 127a0a89d2SRobert Watson * documentation and/or other materials provided with the distribution. 137a0a89d2SRobert Watson * 3. Neither the name of Apple Inc. ("Apple") nor the names of 147a0a89d2SRobert Watson * its contributors may be used to endorse or promote products derived 157a0a89d2SRobert Watson * from this software without specific prior written permission. 167a0a89d2SRobert Watson * 177a0a89d2SRobert Watson * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND 187a0a89d2SRobert Watson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 197a0a89d2SRobert Watson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 207a0a89d2SRobert Watson * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR 217a0a89d2SRobert Watson * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 227a0a89d2SRobert Watson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 237a0a89d2SRobert Watson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 247a0a89d2SRobert Watson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 257a0a89d2SRobert Watson * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 267a0a89d2SRobert Watson * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 277a0a89d2SRobert Watson * POSSIBILITY OF SUCH DAMAGE. 287a0a89d2SRobert Watson */ 297a0a89d2SRobert Watson 307a0a89d2SRobert Watson #ifndef _BSM_AUDIT_ERRNO_H_ 317a0a89d2SRobert Watson #define _BSM_AUDIT_ERRNO_H_ 327a0a89d2SRobert Watson 337a0a89d2SRobert Watson /* 347a0a89d2SRobert Watson * For the purposes of portable encoding, we convert between local error 357a0a89d2SRobert Watson * numbers and Solaris error numbers (as well as some extensions for error 367a0a89d2SRobert Watson * numbers that don't exist in Solaris). Although the first 35 or so 377a0a89d2SRobert Watson * constants are the same across all OS's, we don't handle that in any 387a0a89d2SRobert Watson * special way. 397a0a89d2SRobert Watson * 407a0a89d2SRobert Watson * When adding constants here, also add them to bsm_errno.c. 417a0a89d2SRobert Watson */ 42c74c7b73SRobert Watson #define BSM_ERRNO_ESUCCESS 0 43c74c7b73SRobert Watson #define BSM_ERRNO_EPERM 1 44c74c7b73SRobert Watson #define BSM_ERRNO_ENOENT 2 45c74c7b73SRobert Watson #define BSM_ERRNO_ESRCH 3 46c74c7b73SRobert Watson #define BSM_ERRNO_EINTR 4 47c74c7b73SRobert Watson #define BSM_ERRNO_EIO 5 48c74c7b73SRobert Watson #define BSM_ERRNO_ENXIO 6 49c74c7b73SRobert Watson #define BSM_ERRNO_E2BIG 7 50c74c7b73SRobert Watson #define BSM_ERRNO_ENOEXEC 8 51c74c7b73SRobert Watson #define BSM_ERRNO_EBADF 9 52c74c7b73SRobert Watson #define BSM_ERRNO_ECHILD 10 53c74c7b73SRobert Watson #define BSM_ERRNO_EAGAIN 11 54c74c7b73SRobert Watson #define BSM_ERRNO_ENOMEM 12 55c74c7b73SRobert Watson #define BSM_ERRNO_EACCES 13 56c74c7b73SRobert Watson #define BSM_ERRNO_EFAULT 14 57c74c7b73SRobert Watson #define BSM_ERRNO_ENOTBLK 15 58c74c7b73SRobert Watson #define BSM_ERRNO_EBUSY 16 59c74c7b73SRobert Watson #define BSM_ERRNO_EEXIST 17 60c74c7b73SRobert Watson #define BSM_ERRNO_EXDEV 18 61c74c7b73SRobert Watson #define BSM_ERRNO_ENODEV 19 62c74c7b73SRobert Watson #define BSM_ERRNO_ENOTDIR 20 63c74c7b73SRobert Watson #define BSM_ERRNO_EISDIR 21 64c74c7b73SRobert Watson #define BSM_ERRNO_EINVAL 22 65c74c7b73SRobert Watson #define BSM_ERRNO_ENFILE 23 66c74c7b73SRobert Watson #define BSM_ERRNO_EMFILE 24 67c74c7b73SRobert Watson #define BSM_ERRNO_ENOTTY 25 68c74c7b73SRobert Watson #define BSM_ERRNO_ETXTBSY 26 69c74c7b73SRobert Watson #define BSM_ERRNO_EFBIG 27 70c74c7b73SRobert Watson #define BSM_ERRNO_ENOSPC 28 71c74c7b73SRobert Watson #define BSM_ERRNO_ESPIPE 29 72c74c7b73SRobert Watson #define BSM_ERRNO_EROFS 30 73c74c7b73SRobert Watson #define BSM_ERRNO_EMLINK 31 74c74c7b73SRobert Watson #define BSM_ERRNO_EPIPE 32 75c74c7b73SRobert Watson #define BSM_ERRNO_EDOM 33 76c74c7b73SRobert Watson #define BSM_ERRNO_ERANGE 34 77c74c7b73SRobert Watson #define BSM_ERRNO_ENOMSG 35 78c74c7b73SRobert Watson #define BSM_ERRNO_EIDRM 36 79c74c7b73SRobert Watson #define BSM_ERRNO_ECHRNG 37 /* Solaris/Linux-specific. */ 80c74c7b73SRobert Watson #define BSM_ERRNO_EL2NSYNC 38 /* Solaris/Linux-specific. */ 81c74c7b73SRobert Watson #define BSM_ERRNO_EL3HLT 39 /* Solaris/Linux-specific. */ 82c74c7b73SRobert Watson #define BSM_ERRNO_EL3RST 40 /* Solaris/Linux-specific. */ 83c74c7b73SRobert Watson #define BSM_ERRNO_ELNRNG 41 /* Solaris/Linux-specific. */ 84c74c7b73SRobert Watson #define BSM_ERRNO_EUNATCH 42 /* Solaris/Linux-specific. */ 85c74c7b73SRobert Watson #define BSM_ERRNO_ENOCSI 43 /* Solaris/Linux-specific. */ 86c74c7b73SRobert Watson #define BSM_ERRNO_EL2HLT 44 /* Solaris/Linux-specific. */ 87c74c7b73SRobert Watson #define BSM_ERRNO_EDEADLK 45 88c74c7b73SRobert Watson #define BSM_ERRNO_ENOLCK 46 89c74c7b73SRobert Watson #define BSM_ERRNO_ECANCELED 47 90c74c7b73SRobert Watson #define BSM_ERRNO_ENOTSUP 48 91c74c7b73SRobert Watson #define BSM_ERRNO_EDQUOT 49 92c74c7b73SRobert Watson #define BSM_ERRNO_EBADE 50 /* Solaris/Linux-specific. */ 93c74c7b73SRobert Watson #define BSM_ERRNO_EBADR 51 /* Solaris/Linux-specific. */ 94c74c7b73SRobert Watson #define BSM_ERRNO_EXFULL 52 /* Solaris/Linux-specific. */ 95c74c7b73SRobert Watson #define BSM_ERRNO_ENOANO 53 /* Solaris/Linux-specific. */ 96c74c7b73SRobert Watson #define BSM_ERRNO_EBADRQC 54 /* Solaris/Linux-specific. */ 97c74c7b73SRobert Watson #define BSM_ERRNO_EBADSLT 55 /* Solaris/Linux-specific. */ 98c74c7b73SRobert Watson #define BSM_ERRNO_EDEADLOCK 56 /* Solaris-specific. */ 99c74c7b73SRobert Watson #define BSM_ERRNO_EBFONT 57 /* Solaris/Linux-specific. */ 100c74c7b73SRobert Watson #define BSM_ERRNO_EOWNERDEAD 58 /* Solaris/Linux-specific. */ 101c74c7b73SRobert Watson #define BSM_ERRNO_ENOTRECOVERABLE 59 /* Solaris/Linux-specific. */ 102c74c7b73SRobert Watson #define BSM_ERRNO_ENOSTR 60 /* Solaris/Darwin/Linux-specific. */ 103c74c7b73SRobert Watson #define BSM_ERRNO_ENODATA 61 /* Solaris/Darwin/Linux-specific. */ 104c74c7b73SRobert Watson #define BSM_ERRNO_ETIME 62 /* Solaris/Darwin/Linux-specific. */ 105c74c7b73SRobert Watson #define BSM_ERRNO_ENOSR 63 /* Solaris/Darwin/Linux-specific. */ 106c74c7b73SRobert Watson #define BSM_ERRNO_ENONET 64 /* Solaris/Linux-specific. */ 107c74c7b73SRobert Watson #define BSM_ERRNO_ENOPKG 65 /* Solaris/Linux-specific. */ 108c74c7b73SRobert Watson #define BSM_ERRNO_EREMOTE 66 109c74c7b73SRobert Watson #define BSM_ERRNO_ENOLINK 67 110c74c7b73SRobert Watson #define BSM_ERRNO_EADV 68 /* Solaris/Linux-specific. */ 111c74c7b73SRobert Watson #define BSM_ERRNO_ESRMNT 69 /* Solaris/Linux-specific. */ 112c74c7b73SRobert Watson #define BSM_ERRNO_ECOMM 70 /* Solaris/Linux-specific. */ 113c74c7b73SRobert Watson #define BSM_ERRNO_EPROTO 71 114c74c7b73SRobert Watson #define BSM_ERRNO_ELOCKUNMAPPED 72 /* Solaris-specific. */ 115c74c7b73SRobert Watson #define BSM_ERRNO_ENOTACTIVE 73 /* Solaris-specific. */ 116c74c7b73SRobert Watson #define BSM_ERRNO_EMULTIHOP 74 117c74c7b73SRobert Watson #define BSM_ERRNO_EBADMSG 77 118c74c7b73SRobert Watson #define BSM_ERRNO_ENAMETOOLONG 78 119c74c7b73SRobert Watson #define BSM_ERRNO_EOVERFLOW 79 120c74c7b73SRobert Watson #define BSM_ERRNO_ENOTUNIQ 80 /* Solaris/Linux-specific. */ 121c74c7b73SRobert Watson #define BSM_ERRNO_EBADFD 81 /* Solaris/Linux-specific. */ 122c74c7b73SRobert Watson #define BSM_ERRNO_EREMCHG 82 /* Solaris/Linux-specific. */ 123c74c7b73SRobert Watson #define BSM_ERRNO_ELIBACC 83 /* Solaris/Linux-specific. */ 124c74c7b73SRobert Watson #define BSM_ERRNO_ELIBBAD 84 /* Solaris/Linux-specific. */ 125c74c7b73SRobert Watson #define BSM_ERRNO_ELIBSCN 85 /* Solaris/Linux-specific. */ 126c74c7b73SRobert Watson #define BSM_ERRNO_ELIBMAX 86 /* Solaris/Linux-specific. */ 127c74c7b73SRobert Watson #define BSM_ERRNO_ELIBEXEC 87 /* Solaris/Linux-specific. */ 128c74c7b73SRobert Watson #define BSM_ERRNO_EILSEQ 88 129c74c7b73SRobert Watson #define BSM_ERRNO_ENOSYS 89 130c74c7b73SRobert Watson #define BSM_ERRNO_ELOOP 90 131c74c7b73SRobert Watson #define BSM_ERRNO_ERESTART 91 132c74c7b73SRobert Watson #define BSM_ERRNO_ESTRPIPE 92 /* Solaris/Linux-specific. */ 133c74c7b73SRobert Watson #define BSM_ERRNO_ENOTEMPTY 93 134c74c7b73SRobert Watson #define BSM_ERRNO_EUSERS 94 135c74c7b73SRobert Watson #define BSM_ERRNO_ENOTSOCK 95 136c74c7b73SRobert Watson #define BSM_ERRNO_EDESTADDRREQ 96 137c74c7b73SRobert Watson #define BSM_ERRNO_EMSGSIZE 97 138c74c7b73SRobert Watson #define BSM_ERRNO_EPROTOTYPE 98 139c74c7b73SRobert Watson #define BSM_ERRNO_ENOPROTOOPT 99 140c74c7b73SRobert Watson #define BSM_ERRNO_EPROTONOSUPPORT 120 141c74c7b73SRobert Watson #define BSM_ERRNO_ESOCKTNOSUPPORT 121 142c74c7b73SRobert Watson #define BSM_ERRNO_EOPNOTSUPP 122 143c74c7b73SRobert Watson #define BSM_ERRNO_EPFNOSUPPORT 123 144c74c7b73SRobert Watson #define BSM_ERRNO_EAFNOSUPPORT 124 145c74c7b73SRobert Watson #define BSM_ERRNO_EADDRINUSE 125 146c74c7b73SRobert Watson #define BSM_ERRNO_EADDRNOTAVAIL 126 147c74c7b73SRobert Watson #define BSM_ERRNO_ENETDOWN 127 148c74c7b73SRobert Watson #define BSM_ERRNO_ENETUNREACH 128 149c74c7b73SRobert Watson #define BSM_ERRNO_ENETRESET 129 150c74c7b73SRobert Watson #define BSM_ERRNO_ECONNABORTED 130 151c74c7b73SRobert Watson #define BSM_ERRNO_ECONNRESET 131 152c74c7b73SRobert Watson #define BSM_ERRNO_ENOBUFS 132 153c74c7b73SRobert Watson #define BSM_ERRNO_EISCONN 133 154c74c7b73SRobert Watson #define BSM_ERRNO_ENOTCONN 134 155c74c7b73SRobert Watson #define BSM_ERRNO_ESHUTDOWN 143 156c74c7b73SRobert Watson #define BSM_ERRNO_ETOOMANYREFS 144 157c74c7b73SRobert Watson #define BSM_ERRNO_ETIMEDOUT 145 158c74c7b73SRobert Watson #define BSM_ERRNO_ECONNREFUSED 146 159c74c7b73SRobert Watson #define BSM_ERRNO_EHOSTDOWN 147 160c74c7b73SRobert Watson #define BSM_ERRNO_EHOSTUNREACH 148 161c74c7b73SRobert Watson #define BSM_ERRNO_EALREADY 149 162c74c7b73SRobert Watson #define BSM_ERRNO_EINPROGRESS 150 163c74c7b73SRobert Watson #define BSM_ERRNO_ESTALE 151 1647a0a89d2SRobert Watson 1657a0a89d2SRobert Watson /* 1667a0a89d2SRobert Watson * OpenBSM constants for error numbers not defined in Solaris. In the event 1677a0a89d2SRobert Watson * that these errors are added to Solaris, we will deprecate the OpenBSM 1687a0a89d2SRobert Watson * numbers in the same way we do for audit event constants. 1697a0a89d2SRobert Watson * 1707a0a89d2SRobert Watson * ELAST doesn't get a constant in the BSM space. 1717a0a89d2SRobert Watson */ 172c74c7b73SRobert Watson #define BSM_ERRNO_EPROCLIM 190 /* FreeBSD/Darwin-specific. */ 173c74c7b73SRobert Watson #define BSM_ERRNO_EBADRPC 191 /* FreeBSD/Darwin-specific. */ 174c74c7b73SRobert Watson #define BSM_ERRNO_ERPCMISMATCH 192 /* FreeBSD/Darwin-specific. */ 175c74c7b73SRobert Watson #define BSM_ERRNO_EPROGUNAVAIL 193 /* FreeBSD/Darwin-specific. */ 176c74c7b73SRobert Watson #define BSM_ERRNO_EPROGMISMATCH 194 /* FreeBSD/Darwin-specific. */ 177c74c7b73SRobert Watson #define BSM_ERRNO_EPROCUNAVAIL 195 /* FreeBSD/Darwin-specific. */ 178c74c7b73SRobert Watson #define BSM_ERRNO_EFTYPE 196 /* FreeBSD/Darwin-specific. */ 179c74c7b73SRobert Watson #define BSM_ERRNO_EAUTH 197 /* FreeBSD/Darwin-specific. */ 180c74c7b73SRobert Watson #define BSM_ERRNO_ENEEDAUTH 198 /* FreeBSD/Darwin-specific. */ 181c74c7b73SRobert Watson #define BSM_ERRNO_ENOATTR 199 /* FreeBSD/Darwin-specific. */ 182c74c7b73SRobert Watson #define BSM_ERRNO_EDOOFUS 200 /* FreeBSD-specific. */ 183c74c7b73SRobert Watson #define BSM_ERRNO_EJUSTRETURN 201 /* FreeBSD-specific. */ 184c74c7b73SRobert Watson #define BSM_ERRNO_ENOIOCTL 202 /* FreeBSD-specific. */ 185c74c7b73SRobert Watson #define BSM_ERRNO_EDIRIOCTL 203 /* FreeBSD-specific. */ 186c74c7b73SRobert Watson #define BSM_ERRNO_EPWROFF 204 /* Darwin-specific. */ 187c74c7b73SRobert Watson #define BSM_ERRNO_EDEVERR 205 /* Darwin-specific. */ 188c74c7b73SRobert Watson #define BSM_ERRNO_EBADEXEC 206 /* Darwin-specific. */ 189c74c7b73SRobert Watson #define BSM_ERRNO_EBADARCH 207 /* Darwin-specific. */ 190c74c7b73SRobert Watson #define BSM_ERRNO_ESHLIBVERS 208 /* Darwin-specific. */ 191c74c7b73SRobert Watson #define BSM_ERRNO_EBADMACHO 209 /* Darwin-specific. */ 192c74c7b73SRobert Watson #define BSM_ERRNO_EPOLICY 210 /* Darwin-specific. */ 193c74c7b73SRobert Watson #define BSM_ERRNO_EDOTDOT 211 /* Linux-specific. */ 194c74c7b73SRobert Watson #define BSM_ERRNO_EUCLEAN 212 /* Linux-specific. */ 195c74c7b73SRobert Watson #define BSM_ERRNO_ENOTNAM 213 /* Linux(Xenix?)-specific. */ 196c74c7b73SRobert Watson #define BSM_ERRNO_ENAVAIL 214 /* Linux(Xenix?)-specific. */ 197c74c7b73SRobert Watson #define BSM_ERRNO_EISNAM 215 /* Linux(Xenix?)-specific. */ 198c74c7b73SRobert Watson #define BSM_ERRNO_EREMOTEIO 216 /* Linux-specific. */ 199c74c7b73SRobert Watson #define BSM_ERRNO_ENOMEDIUM 217 /* Linux-specific. */ 200c74c7b73SRobert Watson #define BSM_ERRNO_EMEDIUMTYPE 218 /* Linux-specific. */ 201c74c7b73SRobert Watson #define BSM_ERRNO_ENOKEY 219 /* Linux-specific. */ 202c74c7b73SRobert Watson #define BSM_ERRNO_EKEYEXPIRED 220 /* Linux-specific. */ 203c74c7b73SRobert Watson #define BSM_ERRNO_EKEYREVOKED 221 /* Linux-specific. */ 204c74c7b73SRobert Watson #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ 205aa772005SRobert Watson #define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ 206aa772005SRobert Watson #define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ 207*88640c0eSKirk McKusick #define BSM_ERRNO_EINTEGRITY 225 /* FreeBSD-specific. */ 2087a0a89d2SRobert Watson 2097a0a89d2SRobert Watson /* 2107a0a89d2SRobert Watson * In the event that OpenBSM doesn't have a file representation of a local 2117a0a89d2SRobert Watson * error number, use this. 2127a0a89d2SRobert Watson */ 213c74c7b73SRobert Watson #define BSM_ERRNO_UNKNOWN 250 /* OpenBSM-specific. */ 2147a0a89d2SRobert Watson 2157a0a89d2SRobert Watson #endif /* !_BSM_AUDIT_ERRNO_H_ */ 216