1 /* $NetBSD: osf1_cvt_errno.c,v 1.6 2001/11/13 02:09:11 lukem Exp $ */
4 * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Christopher G. Demetriou
17 * for the NetBSD Project.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #include <sys/cdefs.h>
34 __KERNEL_RCSID(0, "$NetBSD: osf1_cvt_errno.c,v 1.6 2001/11/13 02:09:11 lukem Exp $");
36 #include <compat/osf1/osf1.h>
37 #include <compat/osf1/osf1_cvt.h>
40 * This table is used to translate NetBSD errnos to OSF/1 errnos
41 * when returning from a system call.
43 * It is up to date as of Digital UNIX V4.0 and NetBSD 1.4.
46 const int native_to_osf1_errno
[] = {
48 OSF1_EPERM
, /* EPERM (1) -> 1 */
49 OSF1_ENOENT
, /* ENOENT (2) -> 2 */
50 OSF1_ESRCH
, /* ESRCH (3) -> 3 */
51 OSF1_EINTR
, /* EINTR (4) -> 4 */
52 OSF1_EIO
, /* EIO (5) -> 5 */
53 OSF1_ENXIO
, /* ENXIO (6) -> 6 */
54 OSF1_E2BIG
, /* E2BIG (7) -> 7 */
55 OSF1_ENOEXEC
, /* ENOEXEC (8) -> 8 */
56 OSF1_EBADF
, /* EBADF (9) -> 9 */
57 OSF1_ECHILD
, /* ECHILD (10) -> 10 */
58 OSF1_EDEADLK
, /* EDEADLK (11) -> 11 */
59 OSF1_ENOMEM
, /* ENOMEM (12) -> 12 */
60 OSF1_EACCES
, /* EACCES (13) -> 13 */
61 OSF1_EFAULT
, /* EFAULT (14) -> 14 */
62 OSF1_ENOTBLK
, /* ENOTBLK (15) -> 15 */
63 OSF1_EBUSY
, /* EBUSY (16) -> 16 */
64 OSF1_EEXIST
, /* EEXIST (17) -> 17 */
65 OSF1_EXDEV
, /* EXDEV (18) -> 18 */
66 OSF1_ENODEV
, /* ENODEV (19) -> 19 */
67 OSF1_ENOTDIR
, /* ENOTDIR (20) -> 20 */
68 OSF1_EISDIR
, /* EISDIR (21) -> 21 */
69 OSF1_EINVAL
, /* EINVAL (22) -> 22 */
70 OSF1_ENFILE
, /* ENFILE (23) -> 23 */
71 OSF1_EMFILE
, /* EMFILE (24) -> 24 */
72 OSF1_ENOTTY
, /* ENOTTY (25) -> 25 */
73 OSF1_ETXTBSY
, /* ETXTBSY (26) -> 26 */
74 OSF1_EFBIG
, /* EFBIG (27) -> 27 */
75 OSF1_ENOSPC
, /* ENOSPC (28) -> 28 */
76 OSF1_ESPIPE
, /* ESPIPE (29) -> 29 */
77 OSF1_EROFS
, /* EROFS (30) -> 30 */
78 OSF1_EMLINK
, /* EMLINK (31) -> 31 */
79 OSF1_EPIPE
, /* EPIPE (32) -> 32 */
80 OSF1_EDOM
, /* EDOM (33) -> 33 */
81 OSF1_ERANGE
, /* ERANGE (34) -> 34 */
82 OSF1_EWOULDBLOCK
, /* EAGAIN (35) -> OSF1_EWOULDBLOCK (35) */
83 OSF1_EINPROGRESS
, /* EINPROGRESS (36) -> 36 */
84 OSF1_EALREADY
, /* EALREADY (37) -> 37 */
85 OSF1_ENOTSOCK
, /* ENOTSOCK (38) -> 38 */
86 OSF1_EDESTADDRREQ
, /* EDESTADDRREQ (39) -> 39 */
87 OSF1_EMSGSIZE
, /* EMSGSIZE (40) -> 40 */
88 OSF1_EPROTOTYPE
, /* EPROTOTYPE (41) -> 41 */
89 OSF1_ENOPROTOOPT
, /* ENOPROTOOPT (42) -> 42 */
90 OSF1_EPROTONOSUPPORT
, /* EPROTONOSUPPORT (43) -> 43 */
91 OSF1_ESOCKTNOSUPPORT
, /* ESOCKTNOSUPPORT (44) -> 44 */
92 OSF1_EOPNOTSUPP
, /* EOPNOTSUPP (45) -> 45 */
93 OSF1_EPFNOSUPPORT
, /* EPFNOSUPPORT (46) -> 46 */
94 OSF1_EAFNOSUPPORT
, /* EAFNOSUPPORT (47) -> 47 */
95 OSF1_EADDRINUSE
, /* EADDRINUSE (48) -> 48 */
96 OSF1_EADDRNOTAVAIL
, /* EADDRNOTAVAIL (49) -> 49 */
97 OSF1_ENETDOWN
, /* ENETDOWN (50) -> 50 */
98 OSF1_ENETUNREACH
, /* ENETUNREACH (51) -> 51 */
99 OSF1_ENETRESET
, /* ENETRESET (52) -> 52 */
100 OSF1_ECONNABORTED
, /* ECONNABORTED (53) -> 53 */
101 OSF1_ECONNRESET
, /* ECONNRESET (54) -> 54 */
102 OSF1_ENOBUFS
, /* ENOBUFS (55) -> 55 */
103 OSF1_EISCONN
, /* EISCONN (56) -> 56 */
104 OSF1_ENOTCONN
, /* ENOTCONN (57) -> 57 */
105 OSF1_ESHUTDOWN
, /* ESHUTDOWN (58) -> 58 */
106 OSF1_ETOOMANYREFS
, /* ETOOMANYREFS (59) -> 59 */
107 OSF1_ETIMEDOUT
, /* ETIMEDOUT (60) -> 60 */
108 OSF1_ECONNREFUSED
, /* ECONNREFUSED (61) -> 61 */
109 OSF1_ELOOP
, /* ELOOP (62) -> 62 */
110 OSF1_ENAMETOOLONG
, /* ENAMETOOLONG (63) -> 63 */
111 OSF1_EHOSTDOWN
, /* EHOSTDOWN (64) -> 64 */
112 OSF1_EHOSTUNREACH
, /* EHOSTUNREACH (65) -> 65 */
113 OSF1_ENOTEMPTY
, /* ENOTEMPTY (66) -> 66 */
114 OSF1_EPROCLIM
, /* EPROCLIM (67) -> 67 */
115 OSF1_EUSERS
, /* EUSERS (68) -> 68 */
116 OSF1_EDQUOT
, /* EDQUOT (69) -> 69 */
117 OSF1_ESTALE
, /* ESTALE (70) -> 70 */
118 OSF1_EREMOTE
, /* EREMOTE (71) -> 71 */
119 OSF1_EBADRPC
, /* EBADRPC (72) -> 72 */
120 OSF1_ERPCMISMATCH
, /* ERPCMISMATCH (73) -> 73 */
121 OSF1_EPROGUNAVAIL
, /* EPROGUNAVAIL (74) -> 74 */
122 OSF1_EPROGMISMATCH
, /* EPROGMISMATCH (75) -> 75 */
123 OSF1_EPROCUNAVAIL
, /* EPROCUNAVAIL (76) -> 76 */
124 OSF1_ENOLCK
, /* ENOLCK (77) -> 77 */
125 OSF1_ENOSYS
, /* ENOSYS (78) -> 78 */
126 OSF1_EFTYPE
, /* EFTYPE (79) -> 79 */
127 OSF1_ENOSYS
, /* EAUTH (80) has no equivalent */
128 OSF1_ENOSYS
, /* ENEEDAUTH (81) has no equivalent */
129 OSF1_EIDRM
, /* EIDRM (82) -> 81 */
130 OSF1_ENOMSG
, /* ENOMSG (83) -> 80 */
131 OSF1_EOVERFLOW
, /* EOVERFLOW (84) -> 103 */