1186647Srwatson/*- 2186647Srwatson * Copyright (c) 2008 Apple Inc. 3186647Srwatson * All rights reserved. 4186647Srwatson * 5186647Srwatson * Redistribution and use in source and binary forms, with or without 6186647Srwatson * modification, are permitted provided that the following conditions 7186647Srwatson * are met: 8186647Srwatson * 1. Redistributions of source code must retain the above copyright 9186647Srwatson * notice, this list of conditions and the following disclaimer. 10186647Srwatson * 2. Redistributions in binary form must reproduce the above copyright 11186647Srwatson * notice, this list of conditions and the following disclaimer in the 12186647Srwatson * documentation and/or other materials provided with the distribution. 13186647Srwatson * 3. Neither the name of Apple Inc. ("Apple") nor the names of 14186647Srwatson * its contributors may be used to endorse or promote products derived 15186647Srwatson * from this software without specific prior written permission. 16186647Srwatson * 17186647Srwatson * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND 18186647Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19186647Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20186647Srwatson * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR 21186647Srwatson * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22186647Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23186647Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24186647Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25186647Srwatson * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26186647Srwatson * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27186647Srwatson * POSSIBILITY OF SUCH DAMAGE. 28186647Srwatson * 29186647Srwatson * $FreeBSD$ 30186647Srwatson */ 31186647Srwatson 32186647Srwatson#ifndef _BSM_AUDIT_ERRNO_H_ 33186647Srwatson#define _BSM_AUDIT_ERRNO_H_ 34186647Srwatson 35186647Srwatson/* 36186647Srwatson * For the purposes of portable encoding, we convert between local error 37186647Srwatson * numbers and Solaris error numbers (as well as some extensions for error 38186647Srwatson * numbers that don't exist in Solaris). Although the first 35 or so 39186647Srwatson * constants are the same across all OS's, we don't handle that in any 40186647Srwatson * special way. 41186647Srwatson * 42186647Srwatson * When adding constants here, also add them to bsm_errno.c. 43186647Srwatson */ 44187214Srwatson#define BSM_ERRNO_ESUCCESS 0 45187214Srwatson#define BSM_ERRNO_EPERM 1 46187214Srwatson#define BSM_ERRNO_ENOENT 2 47187214Srwatson#define BSM_ERRNO_ESRCH 3 48187214Srwatson#define BSM_ERRNO_EINTR 4 49187214Srwatson#define BSM_ERRNO_EIO 5 50187214Srwatson#define BSM_ERRNO_ENXIO 6 51187214Srwatson#define BSM_ERRNO_E2BIG 7 52187214Srwatson#define BSM_ERRNO_ENOEXEC 8 53187214Srwatson#define BSM_ERRNO_EBADF 9 54187214Srwatson#define BSM_ERRNO_ECHILD 10 55187214Srwatson#define BSM_ERRNO_EAGAIN 11 56187214Srwatson#define BSM_ERRNO_ENOMEM 12 57187214Srwatson#define BSM_ERRNO_EACCES 13 58187214Srwatson#define BSM_ERRNO_EFAULT 14 59187214Srwatson#define BSM_ERRNO_ENOTBLK 15 60187214Srwatson#define BSM_ERRNO_EBUSY 16 61187214Srwatson#define BSM_ERRNO_EEXIST 17 62187214Srwatson#define BSM_ERRNO_EXDEV 18 63187214Srwatson#define BSM_ERRNO_ENODEV 19 64187214Srwatson#define BSM_ERRNO_ENOTDIR 20 65187214Srwatson#define BSM_ERRNO_EISDIR 21 66187214Srwatson#define BSM_ERRNO_EINVAL 22 67187214Srwatson#define BSM_ERRNO_ENFILE 23 68187214Srwatson#define BSM_ERRNO_EMFILE 24 69187214Srwatson#define BSM_ERRNO_ENOTTY 25 70187214Srwatson#define BSM_ERRNO_ETXTBSY 26 71187214Srwatson#define BSM_ERRNO_EFBIG 27 72187214Srwatson#define BSM_ERRNO_ENOSPC 28 73187214Srwatson#define BSM_ERRNO_ESPIPE 29 74187214Srwatson#define BSM_ERRNO_EROFS 30 75187214Srwatson#define BSM_ERRNO_EMLINK 31 76187214Srwatson#define BSM_ERRNO_EPIPE 32 77187214Srwatson#define BSM_ERRNO_EDOM 33 78187214Srwatson#define BSM_ERRNO_ERANGE 34 79187214Srwatson#define BSM_ERRNO_ENOMSG 35 80187214Srwatson#define BSM_ERRNO_EIDRM 36 81187214Srwatson#define BSM_ERRNO_ECHRNG 37 /* Solaris/Linux-specific. */ 82187214Srwatson#define BSM_ERRNO_EL2NSYNC 38 /* Solaris/Linux-specific. */ 83187214Srwatson#define BSM_ERRNO_EL3HLT 39 /* Solaris/Linux-specific. */ 84187214Srwatson#define BSM_ERRNO_EL3RST 40 /* Solaris/Linux-specific. */ 85187214Srwatson#define BSM_ERRNO_ELNRNG 41 /* Solaris/Linux-specific. */ 86187214Srwatson#define BSM_ERRNO_EUNATCH 42 /* Solaris/Linux-specific. */ 87187214Srwatson#define BSM_ERRNO_ENOCSI 43 /* Solaris/Linux-specific. */ 88187214Srwatson#define BSM_ERRNO_EL2HLT 44 /* Solaris/Linux-specific. */ 89187214Srwatson#define BSM_ERRNO_EDEADLK 45 90187214Srwatson#define BSM_ERRNO_ENOLCK 46 91187214Srwatson#define BSM_ERRNO_ECANCELED 47 92187214Srwatson#define BSM_ERRNO_ENOTSUP 48 93187214Srwatson#define BSM_ERRNO_EDQUOT 49 94187214Srwatson#define BSM_ERRNO_EBADE 50 /* Solaris/Linux-specific. */ 95187214Srwatson#define BSM_ERRNO_EBADR 51 /* Solaris/Linux-specific. */ 96187214Srwatson#define BSM_ERRNO_EXFULL 52 /* Solaris/Linux-specific. */ 97187214Srwatson#define BSM_ERRNO_ENOANO 53 /* Solaris/Linux-specific. */ 98187214Srwatson#define BSM_ERRNO_EBADRQC 54 /* Solaris/Linux-specific. */ 99187214Srwatson#define BSM_ERRNO_EBADSLT 55 /* Solaris/Linux-specific. */ 100187214Srwatson#define BSM_ERRNO_EDEADLOCK 56 /* Solaris-specific. */ 101187214Srwatson#define BSM_ERRNO_EBFONT 57 /* Solaris/Linux-specific. */ 102187214Srwatson#define BSM_ERRNO_EOWNERDEAD 58 /* Solaris/Linux-specific. */ 103187214Srwatson#define BSM_ERRNO_ENOTRECOVERABLE 59 /* Solaris/Linux-specific. */ 104187214Srwatson#define BSM_ERRNO_ENOSTR 60 /* Solaris/Darwin/Linux-specific. */ 105187214Srwatson#define BSM_ERRNO_ENODATA 61 /* Solaris/Darwin/Linux-specific. */ 106187214Srwatson#define BSM_ERRNO_ETIME 62 /* Solaris/Darwin/Linux-specific. */ 107187214Srwatson#define BSM_ERRNO_ENOSR 63 /* Solaris/Darwin/Linux-specific. */ 108187214Srwatson#define BSM_ERRNO_ENONET 64 /* Solaris/Linux-specific. */ 109187214Srwatson#define BSM_ERRNO_ENOPKG 65 /* Solaris/Linux-specific. */ 110187214Srwatson#define BSM_ERRNO_EREMOTE 66 111187214Srwatson#define BSM_ERRNO_ENOLINK 67 112187214Srwatson#define BSM_ERRNO_EADV 68 /* Solaris/Linux-specific. */ 113187214Srwatson#define BSM_ERRNO_ESRMNT 69 /* Solaris/Linux-specific. */ 114187214Srwatson#define BSM_ERRNO_ECOMM 70 /* Solaris/Linux-specific. */ 115187214Srwatson#define BSM_ERRNO_EPROTO 71 116187214Srwatson#define BSM_ERRNO_ELOCKUNMAPPED 72 /* Solaris-specific. */ 117187214Srwatson#define BSM_ERRNO_ENOTACTIVE 73 /* Solaris-specific. */ 118187214Srwatson#define BSM_ERRNO_EMULTIHOP 74 119187214Srwatson#define BSM_ERRNO_EBADMSG 77 120187214Srwatson#define BSM_ERRNO_ENAMETOOLONG 78 121187214Srwatson#define BSM_ERRNO_EOVERFLOW 79 122187214Srwatson#define BSM_ERRNO_ENOTUNIQ 80 /* Solaris/Linux-specific. */ 123187214Srwatson#define BSM_ERRNO_EBADFD 81 /* Solaris/Linux-specific. */ 124187214Srwatson#define BSM_ERRNO_EREMCHG 82 /* Solaris/Linux-specific. */ 125187214Srwatson#define BSM_ERRNO_ELIBACC 83 /* Solaris/Linux-specific. */ 126187214Srwatson#define BSM_ERRNO_ELIBBAD 84 /* Solaris/Linux-specific. */ 127187214Srwatson#define BSM_ERRNO_ELIBSCN 85 /* Solaris/Linux-specific. */ 128187214Srwatson#define BSM_ERRNO_ELIBMAX 86 /* Solaris/Linux-specific. */ 129187214Srwatson#define BSM_ERRNO_ELIBEXEC 87 /* Solaris/Linux-specific. */ 130187214Srwatson#define BSM_ERRNO_EILSEQ 88 131187214Srwatson#define BSM_ERRNO_ENOSYS 89 132187214Srwatson#define BSM_ERRNO_ELOOP 90 133187214Srwatson#define BSM_ERRNO_ERESTART 91 134187214Srwatson#define BSM_ERRNO_ESTRPIPE 92 /* Solaris/Linux-specific. */ 135187214Srwatson#define BSM_ERRNO_ENOTEMPTY 93 136187214Srwatson#define BSM_ERRNO_EUSERS 94 137187214Srwatson#define BSM_ERRNO_ENOTSOCK 95 138187214Srwatson#define BSM_ERRNO_EDESTADDRREQ 96 139187214Srwatson#define BSM_ERRNO_EMSGSIZE 97 140187214Srwatson#define BSM_ERRNO_EPROTOTYPE 98 141187214Srwatson#define BSM_ERRNO_ENOPROTOOPT 99 142187214Srwatson#define BSM_ERRNO_EPROTONOSUPPORT 120 143187214Srwatson#define BSM_ERRNO_ESOCKTNOSUPPORT 121 144187214Srwatson#define BSM_ERRNO_EOPNOTSUPP 122 145187214Srwatson#define BSM_ERRNO_EPFNOSUPPORT 123 146187214Srwatson#define BSM_ERRNO_EAFNOSUPPORT 124 147187214Srwatson#define BSM_ERRNO_EADDRINUSE 125 148187214Srwatson#define BSM_ERRNO_EADDRNOTAVAIL 126 149187214Srwatson#define BSM_ERRNO_ENETDOWN 127 150187214Srwatson#define BSM_ERRNO_ENETUNREACH 128 151187214Srwatson#define BSM_ERRNO_ENETRESET 129 152187214Srwatson#define BSM_ERRNO_ECONNABORTED 130 153187214Srwatson#define BSM_ERRNO_ECONNRESET 131 154187214Srwatson#define BSM_ERRNO_ENOBUFS 132 155187214Srwatson#define BSM_ERRNO_EISCONN 133 156187214Srwatson#define BSM_ERRNO_ENOTCONN 134 157187214Srwatson#define BSM_ERRNO_ESHUTDOWN 143 158187214Srwatson#define BSM_ERRNO_ETOOMANYREFS 144 159187214Srwatson#define BSM_ERRNO_ETIMEDOUT 145 160187214Srwatson#define BSM_ERRNO_ECONNREFUSED 146 161187214Srwatson#define BSM_ERRNO_EHOSTDOWN 147 162187214Srwatson#define BSM_ERRNO_EHOSTUNREACH 148 163187214Srwatson#define BSM_ERRNO_EALREADY 149 164187214Srwatson#define BSM_ERRNO_EINPROGRESS 150 165187214Srwatson#define BSM_ERRNO_ESTALE 151 166186647Srwatson 167186647Srwatson/* 168186647Srwatson * OpenBSM constants for error numbers not defined in Solaris. In the event 169186647Srwatson * that these errors are added to Solaris, we will deprecate the OpenBSM 170186647Srwatson * numbers in the same way we do for audit event constants. 171186647Srwatson * 172186647Srwatson * ELAST doesn't get a constant in the BSM space. 173186647Srwatson */ 174187214Srwatson#define BSM_ERRNO_EPROCLIM 190 /* FreeBSD/Darwin-specific. */ 175187214Srwatson#define BSM_ERRNO_EBADRPC 191 /* FreeBSD/Darwin-specific. */ 176187214Srwatson#define BSM_ERRNO_ERPCMISMATCH 192 /* FreeBSD/Darwin-specific. */ 177187214Srwatson#define BSM_ERRNO_EPROGUNAVAIL 193 /* FreeBSD/Darwin-specific. */ 178187214Srwatson#define BSM_ERRNO_EPROGMISMATCH 194 /* FreeBSD/Darwin-specific. */ 179187214Srwatson#define BSM_ERRNO_EPROCUNAVAIL 195 /* FreeBSD/Darwin-specific. */ 180187214Srwatson#define BSM_ERRNO_EFTYPE 196 /* FreeBSD/Darwin-specific. */ 181187214Srwatson#define BSM_ERRNO_EAUTH 197 /* FreeBSD/Darwin-specific. */ 182187214Srwatson#define BSM_ERRNO_ENEEDAUTH 198 /* FreeBSD/Darwin-specific. */ 183187214Srwatson#define BSM_ERRNO_ENOATTR 199 /* FreeBSD/Darwin-specific. */ 184187214Srwatson#define BSM_ERRNO_EDOOFUS 200 /* FreeBSD-specific. */ 185187214Srwatson#define BSM_ERRNO_EJUSTRETURN 201 /* FreeBSD-specific. */ 186187214Srwatson#define BSM_ERRNO_ENOIOCTL 202 /* FreeBSD-specific. */ 187187214Srwatson#define BSM_ERRNO_EDIRIOCTL 203 /* FreeBSD-specific. */ 188187214Srwatson#define BSM_ERRNO_EPWROFF 204 /* Darwin-specific. */ 189187214Srwatson#define BSM_ERRNO_EDEVERR 205 /* Darwin-specific. */ 190187214Srwatson#define BSM_ERRNO_EBADEXEC 206 /* Darwin-specific. */ 191187214Srwatson#define BSM_ERRNO_EBADARCH 207 /* Darwin-specific. */ 192187214Srwatson#define BSM_ERRNO_ESHLIBVERS 208 /* Darwin-specific. */ 193187214Srwatson#define BSM_ERRNO_EBADMACHO 209 /* Darwin-specific. */ 194187214Srwatson#define BSM_ERRNO_EPOLICY 210 /* Darwin-specific. */ 195187214Srwatson#define BSM_ERRNO_EDOTDOT 211 /* Linux-specific. */ 196187214Srwatson#define BSM_ERRNO_EUCLEAN 212 /* Linux-specific. */ 197187214Srwatson#define BSM_ERRNO_ENOTNAM 213 /* Linux(Xenix?)-specific. */ 198187214Srwatson#define BSM_ERRNO_ENAVAIL 214 /* Linux(Xenix?)-specific. */ 199187214Srwatson#define BSM_ERRNO_EISNAM 215 /* Linux(Xenix?)-specific. */ 200187214Srwatson#define BSM_ERRNO_EREMOTEIO 216 /* Linux-specific. */ 201187214Srwatson#define BSM_ERRNO_ENOMEDIUM 217 /* Linux-specific. */ 202187214Srwatson#define BSM_ERRNO_EMEDIUMTYPE 218 /* Linux-specific. */ 203187214Srwatson#define BSM_ERRNO_ENOKEY 219 /* Linux-specific. */ 204187214Srwatson#define BSM_ERRNO_EKEYEXPIRED 220 /* Linux-specific. */ 205187214Srwatson#define BSM_ERRNO_EKEYREVOKED 221 /* Linux-specific. */ 206187214Srwatson#define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ 207219128Srwatson#define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ 208219128Srwatson#define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ 209186647Srwatson 210186647Srwatson/* 211186647Srwatson * In the event that OpenBSM doesn't have a file representation of a local 212186647Srwatson * error number, use this. 213186647Srwatson */ 214187214Srwatson#define BSM_ERRNO_UNKNOWN 250 /* OpenBSM-specific. */ 215186647Srwatson 216186647Srwatson#endif /* !_BSM_AUDIT_ERRNO_H_ */ 217