]>
git.saurik.com Git - apple/xnu.git/blob - bsd/sys/errno.h
2 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
27 * Copyright (c) 1982, 1986, 1989, 1993
28 * The Regents of the University of California. All rights reserved.
29 * (c) UNIX System Laboratories, Inc.
30 * All or some portions of this file are derived from material licensed
31 * to the University of California by American Telephone and Telegraph
32 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
33 * the permission of UNIX System Laboratories, Inc.
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
38 * 1. Redistributions of source code must retain the above copyright
39 * notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright
41 * notice, this list of conditions and the following disclaimer in the
42 * documentation and/or other materials provided with the distribution.
43 * 3. All advertising materials mentioning features or use of this software
44 * must display the following acknowledgement:
45 * This product includes software developed by the University of
46 * California, Berkeley and its contributors.
47 * 4. Neither the name of the University nor the names of its contributors
48 * may be used to endorse or promote products derived from this software
49 * without specific prior written permission.
51 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
52 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
53 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
54 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
55 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
57 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
58 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
59 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
60 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 * @(#)errno.h 8.5 (Berkeley) 1/21/94
69 #if !defined(KERNEL) && !defined(KERNEL_PRIVATE)
70 #include <sys/cdefs.h>
72 extern int * __error
__P((void));
73 #define errno (*__error())
81 #define EPERM 1 /* Operation not permitted */
82 #define ENOENT 2 /* No such file or directory */
83 #define ESRCH 3 /* No such process */
84 #define EINTR 4 /* Interrupted system call */
85 #define EIO 5 /* Input/output error */
86 #define ENXIO 6 /* Device not configured */
87 #define E2BIG 7 /* Argument list too long */
88 #define ENOEXEC 8 /* Exec format error */
89 #define EBADF 9 /* Bad file descriptor */
90 #define ECHILD 10 /* No child processes */
91 #define EDEADLK 11 /* Resource deadlock avoided */
93 #define ENOMEM 12 /* Cannot allocate memory */
94 #define EACCES 13 /* Permission denied */
95 #define EFAULT 14 /* Bad address */
97 #define ENOTBLK 15 /* Block device required */
99 #define EBUSY 16 /* Device busy */
100 #define EEXIST 17 /* File exists */
101 #define EXDEV 18 /* Cross-device link */
102 #define ENODEV 19 /* Operation not supported by device */
103 #define ENOTDIR 20 /* Not a directory */
104 #define EISDIR 21 /* Is a directory */
105 #define EINVAL 22 /* Invalid argument */
106 #define ENFILE 23 /* Too many open files in system */
107 #define EMFILE 24 /* Too many open files */
108 #define ENOTTY 25 /* Inappropriate ioctl for device */
109 #ifndef _POSIX_SOURCE
110 #define ETXTBSY 26 /* Text file busy */
112 #define EFBIG 27 /* File too large */
113 #define ENOSPC 28 /* No space left on device */
114 #define ESPIPE 29 /* Illegal seek */
115 #define EROFS 30 /* Read-only file system */
116 #define EMLINK 31 /* Too many links */
117 #define EPIPE 32 /* Broken pipe */
120 #define EDOM 33 /* Numerical argument out of domain */
121 #define ERANGE 34 /* Result too large */
123 /* non-blocking and interrupt i/o */
124 #define EAGAIN 35 /* Resource temporarily unavailable */
125 #ifndef _POSIX_SOURCE
126 #define EWOULDBLOCK EAGAIN /* Operation would block */
127 #define EINPROGRESS 36 /* Operation now in progress */
128 #define EALREADY 37 /* Operation already in progress */
130 /* ipc/network software -- argument errors */
131 #define ENOTSOCK 38 /* Socket operation on non-socket */
132 #define EDESTADDRREQ 39 /* Destination address required */
133 #define EMSGSIZE 40 /* Message too long */
134 #define EPROTOTYPE 41 /* Protocol wrong type for socket */
135 #define ENOPROTOOPT 42 /* Protocol not available */
136 #define EPROTONOSUPPORT 43 /* Protocol not supported */
137 #define ESOCKTNOSUPPORT 44 /* Socket type not supported */
138 #endif /* ! _POSIX_SOURCE */
139 #define ENOTSUP 45 /* Operation not supported */
140 #ifndef _POSIX_SOURCE
141 #define EOPNOTSUPP ENOTSUP /* Operation not supported */
142 #define EPFNOSUPPORT 46 /* Protocol family not supported */
143 #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
144 #define EADDRINUSE 48 /* Address already in use */
145 #define EADDRNOTAVAIL 49 /* Can't assign requested address */
147 /* ipc/network software -- operational errors */
148 #define ENETDOWN 50 /* Network is down */
149 #define ENETUNREACH 51 /* Network is unreachable */
150 #define ENETRESET 52 /* Network dropped connection on reset */
151 #define ECONNABORTED 53 /* Software caused connection abort */
152 #define ECONNRESET 54 /* Connection reset by peer */
153 #define ENOBUFS 55 /* No buffer space available */
154 #define EISCONN 56 /* Socket is already connected */
155 #define ENOTCONN 57 /* Socket is not connected */
156 #define ESHUTDOWN 58 /* Can't send after socket shutdown */
157 #define ETOOMANYREFS 59 /* Too many references: can't splice */
158 #define ETIMEDOUT 60 /* Operation timed out */
159 #define ECONNREFUSED 61 /* Connection refused */
161 #define ELOOP 62 /* Too many levels of symbolic links */
162 #endif /* _POSIX_SOURCE */
163 #define ENAMETOOLONG 63 /* File name too long */
165 /* should be rearranged */
166 #ifndef _POSIX_SOURCE
167 #define EHOSTDOWN 64 /* Host is down */
168 #define EHOSTUNREACH 65 /* No route to host */
169 #endif /* _POSIX_SOURCE */
170 #define ENOTEMPTY 66 /* Directory not empty */
173 #ifndef _POSIX_SOURCE
174 #define EPROCLIM 67 /* Too many processes */
175 #define EUSERS 68 /* Too many users */
176 #define EDQUOT 69 /* Disc quota exceeded */
178 /* Network File System */
179 #define ESTALE 70 /* Stale NFS file handle */
180 #define EREMOTE 71 /* Too many levels of remote in path */
181 #define EBADRPC 72 /* RPC struct is bad */
182 #define ERPCMISMATCH 73 /* RPC version wrong */
183 #define EPROGUNAVAIL 74 /* RPC prog. not avail */
184 #define EPROGMISMATCH 75 /* Program version wrong */
185 #define EPROCUNAVAIL 76 /* Bad procedure for program */
186 #endif /* _POSIX_SOURCE */
188 #define ENOLCK 77 /* No locks available */
189 #define ENOSYS 78 /* Function not implemented */
191 #ifndef _POSIX_SOURCE
192 #define EFTYPE 79 /* Inappropriate file type or format */
193 #define EAUTH 80 /* Authentication error */
194 #define ENEEDAUTH 81 /* Need authenticator */
195 #endif /* _POSIX_SOURCE */
197 /* Intelligent device errors */
198 #define EPWROFF 82 /* Device power is off */
199 #define EDEVERR 83 /* Device error, e.g. paper out */
201 #ifndef _POSIX_SOURCE
202 #define EOVERFLOW 84 /* Value too large to be stored in data type */
204 /* Program loading errors */
205 #define EBADEXEC 85 /* Bad executable */
206 #define EBADARCH 86 /* Bad CPU type in executable */
207 #define ESHLIBVERS 87 /* Shared library version mismatch */
208 #define EBADMACHO 88 /* Malformed Macho file */
210 #define ECANCELED 89 /* Operation canceled */
212 #define EIDRM 90 /* Identifier removed */
213 #define ENOMSG 91 /* No message of desired type */
214 #define EILSEQ 92 /* Illegal byte sequence */
215 #define ENOATTR 93 /* Attribute not found */
217 #define ELAST 93 /* Must be equal largest errno */
218 #endif /* _POSIX_SOURCE */
221 /* pseudo-errors returned inside kernel to modify return to process */
222 #define ERESTART -1 /* restart syscall */
223 #define EJUSTRETURN -2 /* don't modify regs, just return */
225 #endif /* _SYS_ERRNO_H_ */