audit_errno.h revision 186647
1/*- 2 * Copyright (c) 2008 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of Apple Inc. ("Apple") nor the names of 14 * its contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * POSSIBILITY OF SUCH DAMAGE. 28 * 29 * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#4 30 * $FreeBSD: head/sys/bsm/audit_errno.h 186647 2008-12-31 11:12:24Z rwatson $ 31 */ 32 33#ifndef _BSM_AUDIT_ERRNO_H_ 34#define _BSM_AUDIT_ERRNO_H_ 35 36/* 37 * For the purposes of portable encoding, we convert between local error 38 * numbers and Solaris error numbers (as well as some extensions for error 39 * numbers that don't exist in Solaris). Although the first 35 or so 40 * constants are the same across all OS's, we don't handle that in any 41 * special way. 42 * 43 * When adding constants here, also add them to bsm_errno.c. 44 */ 45#define BSM_ESUCCESS 0 46#define BSM_EPERM 1 47#define BSM_ENOENT 2 48#define BSM_ESRCH 3 49#define BSM_EINTR 4 50#define BSM_EIO 5 51#define BSM_ENXIO 6 52#define BSM_E2BIG 7 53#define BSM_ENOEXEC 8 54#define BSM_EBADF 9 55#define BSM_ECHILD 10 56#define BSM_EAGAIN 11 57#define BSM_ENOMEM 12 58#define BSM_EACCES 13 59#define BSM_EFAULT 14 60#define BSM_ENOTBLK 15 61#define BSM_EBUSY 16 62#define BSM_EEXIST 17 63#define BSM_EXDEV 18 64#define BSM_ENODEV 19 65#define BSM_ENOTDIR 20 66#define BSM_EISDIR 21 67#define BSM_EINVAL 22 68#define BSM_ENFILE 23 69#define BSM_EMFILE 24 70#define BSM_ENOTTY 25 71#define BSM_ETXTBSY 26 72#define BSM_EFBIG 27 73#define BSM_ENOSPC 28 74#define BSM_ESPIPE 29 75#define BSM_EROFS 30 76#define BSM_EMLINK 31 77#define BSM_EPIPE 32 78#define BSM_EDOM 33 79#define BSM_ERANGE 34 80#define BSM_ENOMSG 35 81#define BSM_EIDRM 36 82#define BSM_ECHRNG 37 /* Solaris/Linux-specific. */ 83#define BSM_EL2NSYNC 38 /* Solaris/Linux-specific. */ 84#define BSM_EL3HLT 39 /* Solaris/Linux-specific. */ 85#define BSM_EL3RST 40 /* Solaris/Linux-specific. */ 86#define BSM_ELNRNG 41 /* Solaris/Linux-specific. */ 87#define BSM_EUNATCH 42 /* Solaris/Linux-specific. */ 88#define BSM_ENOCSI 43 /* Solaris/Linux-specific. */ 89#define BSM_EL2HLT 44 /* Solaris/Linux-specific. */ 90#define BSM_EDEADLK 45 91#define BSM_ENOLCK 46 92#define BSM_ECANCELED 47 93#define BSM_ENOTSUP 48 94#define BSM_EDQUOT 49 95#define BSM_EBADE 50 /* Solaris/Linux-specific. */ 96#define BSM_EBADR 51 /* Solaris/Linux-specific. */ 97#define BSM_EXFULL 52 /* Solaris/Linux-specific. */ 98#define BSM_ENOANO 53 /* Solaris/Linux-specific. */ 99#define BSM_EBADRQC 54 /* Solaris/Linux-specific. */ 100#define BSM_EBADSLT 55 /* Solaris/Linux-specific. */ 101#define BSM_EDEADLOCK 56 /* Solaris-specific. */ 102#define BSM_EBFONT 57 /* Solaris/Linux-specific. */ 103#define BSM_EOWNERDEAD 58 /* Solaris/Linux-specific. */ 104#define BSM_ENOTRECOVERABLE 59 /* Solaris/Linux-specific. */ 105#define BSM_ENOSTR 60 /* Solaris/Darwin/Linux-specific. */ 106#define BSM_ENODATA 61 /* Solaris/Darwin/Linux-specific. */ 107#define BSM_ETIME 62 /* Solaris/Darwin/Linux-specific. */ 108#define BSM_ENOSR 63 /* Solaris/Darwin/Linux-specific. */ 109#define BSM_ENONET 64 /* Solaris/Linux-specific. */ 110#define BSM_ENOPKG 65 /* Solaris/Linux-specific. */ 111#define BSM_EREMOTE 66 112#define BSM_ENOLINK 67 113#define BSM_EADV 68 /* Solaris/Linux-specific. */ 114#define BSM_ESRMNT 69 /* Solaris/Linux-specific. */ 115#define BSM_ECOMM 70 /* Solaris/Linux-specific. */ 116#define BSM_EPROTO 71 117#define BSM_ELOCKUNMAPPED 72 /* Solaris-specific. */ 118#define BSM_ENOTACTIVE 73 /* Solaris-specific. */ 119#define BSM_EMULTIHOP 74 120#define BSM_EBADMSG 77 121#define BSM_ENAMETOOLONG 78 122#define BSM_EOVERFLOW 79 123#define BSM_ENOTUNIQ 80 /* Solaris/Linux-specific. */ 124#define BSM_EBADFD 81 /* Solaris/Linux-specific. */ 125#define BSM_EREMCHG 82 /* Solaris/Linux-specific. */ 126#define BSM_ELIBACC 83 /* Solaris/Linux-specific. */ 127#define BSM_ELIBBAD 84 /* Solaris/Linux-specific. */ 128#define BSM_ELIBSCN 85 /* Solaris/Linux-specific. */ 129#define BSM_ELIBMAX 86 /* Solaris/Linux-specific. */ 130#define BSM_ELIBEXEC 87 /* Solaris/Linux-specific. */ 131#define BSM_EILSEQ 88 132#define BSM_ENOSYS 89 133#define BSM_ELOOP 90 134#define BSM_ERESTART 91 135#define BSM_ESTRPIPE 92 /* Solaris/Linux-specific. */ 136#define BSM_ENOTEMPTY 93 137#define BSM_EUSERS 94 138#define BSM_ENOTSOCK 95 139#define BSM_EDESTADDRREQ 96 140#define BSM_EMSGSIZE 97 141#define BSM_EPROTOTYPE 98 142#define BSM_ENOPROTOOPT 99 143#define BSM_EPROTONOSUPPORT 120 144#define BSM_ESOCKTNOSUPPORT 121 145#define BSM_EOPNOTSUPP 122 146#define BSM_EPFNOSUPPORT 123 147#define BSM_EAFNOSUPPORT 124 148#define BSM_EADDRINUSE 125 149#define BSM_EADDRNOTAVAIL 126 150#define BSM_ENETDOWN 127 151#define BSM_ENETUNREACH 128 152#define BSM_ENETRESET 129 153#define BSM_ECONNABORTED 130 154#define BSM_ECONNRESET 131 155#define BSM_ENOBUFS 132 156#define BSM_EISCONN 133 157#define BSM_ENOTCONN 134 158#define BSM_ESHUTDOWN 143 159#define BSM_ETOOMANYREFS 144 160#define BSM_ETIMEDOUT 145 161#define BSM_ECONNREFUSED 146 162#define BSM_EHOSTDOWN 147 163#define BSM_EHOSTUNREACH 148 164#define BSM_EALREADY 149 165#define BSM_EINPROGRESS 150 166#define BSM_ESTALE 151 167 168/* 169 * OpenBSM constants for error numbers not defined in Solaris. In the event 170 * that these errors are added to Solaris, we will deprecate the OpenBSM 171 * numbers in the same way we do for audit event constants. 172 * 173 * ELAST doesn't get a constant in the BSM space. 174 */ 175#define BSM_EPROCLIM 190 /* FreeBSD/Darwin-specific. */ 176#define BSM_EBADRPC 191 /* FreeBSD/Darwin-specific. */ 177#define BSM_ERPCMISMATCH 192 /* FreeBSD/Darwin-specific. */ 178#define BSM_EPROGUNAVAIL 193 /* FreeBSD/Darwin-specific. */ 179#define BSM_EPROGMISMATCH 194 /* FreeBSD/Darwin-specific. */ 180#define BSM_EPROCUNAVAIL 195 /* FreeBSD/Darwin-specific. */ 181#define BSM_EFTYPE 196 /* FreeBSD/Darwin-specific. */ 182#define BSM_EAUTH 197 /* FreeBSD/Darwin-specific. */ 183#define BSM_ENEEDAUTH 198 /* FreeBSD/Darwin-specific. */ 184#define BSM_ENOATTR 199 /* FreeBSD/Darwin-specific. */ 185#define BSM_EDOOFUS 200 /* FreeBSD-specific. */ 186#define BSM_EJUSTRETURN 201 /* FreeBSD-specific. */ 187#define BSM_ENOIOCTL 202 /* FreeBSD-specific. */ 188#define BSM_EDIRIOCTL 203 /* FreeBSD-specific. */ 189#define BSM_EPWROFF 204 /* Darwin-specific. */ 190#define BSM_EDEVERR 205 /* Darwin-specific. */ 191#define BSM_EBADEXEC 206 /* Darwin-specific. */ 192#define BSM_EBADARCH 207 /* Darwin-specific. */ 193#define BSM_ESHLIBVERS 208 /* Darwin-specific. */ 194#define BSM_EBADMACHO 209 /* Darwin-specific. */ 195#define BSM_EPOLICY 210 /* Darwin-specific. */ 196#define BSM_EDOTDOT 211 /* Linux-specific. */ 197#define BSM_EUCLEAN 212 /* Linux-specific. */ 198#define BSM_ENOTNAM 213 /* Linux(Xenix?)-specific. */ 199#define BSM_ENAVAIL 214 /* Linux(Xenix?)-specific. */ 200#define BSM_EISNAM 215 /* Linux(Xenix?)-specific. */ 201#define BSM_EREMOTEIO 216 /* Linux-specific. */ 202#define BSM_ENOMEDIUM 217 /* Linux-specific. */ 203#define BSM_EMEDIUMTYPE 218 /* Linux-specific. */ 204#define BSM_ENOKEY 219 /* Linux-specific. */ 205#define BSM_EKEYEXPIRED 220 /* Linux-specific. */ 206#define BSM_EKEYREVOKED 221 /* Linux-specific. */ 207#define BSM_EKEYREJECTED 222 /* Linux-specific. */ 208 209/* 210 * In the event that OpenBSM doesn't have a file representation of a local 211 * error number, use this. 212 */ 213#define BSM_UNKNOWNERR 250 /* OpenBSM-specific. */ 214 215#endif /* !_BSM_AUDIT_ERRNO_H_ */ 216