]> git.saurik.com Git - apple/xnu.git/blob - osfmk/libsa/errno.h
e5d333c95faa5a22df9cc50b92192e3914a61a61
[apple/xnu.git] / osfmk / libsa / errno.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * @OSF_COPYRIGHT@
32 */
33 /*
34 * HISTORY
35 *
36 * Revision 1.1.1.1 1998/09/22 21:05:51 wsanchez
37 * Import of Mac OS X kernel (~semeria)
38 *
39 * Revision 1.1.1.1 1998/03/07 02:25:35 wsanchez
40 * Import of OSF Mach kernel (~mburg)
41 *
42 * Revision 1.1.5.1 1997/01/31 15:46:31 emcmanus
43 * Merged with nmk22b1_shared.
44 * [1997/01/30 08:42:08 emcmanus]
45 *
46 * Revision 1.1.2.5 1996/11/29 13:04:57 emcmanus
47 * Added EIO for libsa_mach's getclock().
48 * [1996/11/29 09:59:19 emcmanus]
49 *
50 * Revision 1.1.2.4 1996/11/08 12:02:15 emcmanus
51 * Replaced errno variable by a macro that calls a function defined
52 * either in libsa_mach or in a threads library.
53 * [1996/11/08 11:48:47 emcmanus]
54 *
55 * Revision 1.1.2.3 1996/10/14 13:31:46 emcmanus
56 * Added ETIMEDOUT.
57 * [1996/10/14 13:29:55 emcmanus]
58 *
59 * Revision 1.1.2.2 1996/10/03 17:53:40 emcmanus
60 * Added new error codes needed by libpthread.a.
61 * [1996/10/03 16:17:42 emcmanus]
62 *
63 * Revision 1.1.2.1 1996/09/30 10:14:32 bruel
64 * First revision.
65 * [96/09/30 bruel]
66 *
67 * $EndLog$
68 */
69
70 /*
71 * ANSI C defines EDOM and ERANGE. POSIX defines the remaining values.
72 * We may at some stage want to surround the extra values with
73 * #ifdef _POSIX_SOURCE.
74 * By an extraordinary coincidence, nearly all the values defined here
75 * correspond exactly to those in OSF/1 and in Linux. Imagine that.
76 * The exception is ETIMEDOUT, which has different values in the two
77 * systems. We use the OSF/1 value here.
78 */
79
80 extern int *__mach_errno_addr(void);
81 #define errno (*__mach_errno_addr())
82
83 #define ESUCCESS 0 /* Success */
84 #define EPERM 1 /* Not owner */
85 #define ESRCH 3 /* No such process */
86 #define EIO 5 /* I/O error */
87 #define ENOMEM 12 /* Not enough core */
88 #define EBUSY 16 /* Mount device busy */
89 #define EINVAL 22 /* Invalid argument */
90 #define EDOM 33 /* Argument too large */
91 #define ERANGE 34 /* Result too large */
92 #define ETIMEDOUT 60 /* Connection timed out */