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