diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-10-27 22:42:12 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-10-27 22:42:12 +0000 |
commit | e2bfb7451a9a7bfa040a6af5ec2d14a7d3990a45 (patch) | |
tree | f3543ae151a35cd5460455dcc13e0267cf354fff /sys | |
parent | 84beca09020e9bcfd9918e33368dee32176666bb (diff) |
Make sure the compat errno mapping arrays go up to ELAST, and correctly
translate the errnos added over the last few releases.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/ibcs2/ibcs2_errno.c | 36 | ||||
-rw-r--r-- | sys/compat/linux/linux_error.c | 67 | ||||
-rw-r--r-- | sys/compat/osf1/osf1_cvt_errno.c | 17 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_errno.c | 14 |
4 files changed, 56 insertions, 78 deletions
diff --git a/sys/compat/ibcs2/ibcs2_errno.c b/sys/compat/ibcs2/ibcs2_errno.c index 4e2bcf68ad7..a03e0178fef 100644 --- a/sys/compat/ibcs2/ibcs2_errno.c +++ b/sys/compat/ibcs2/ibcs2_errno.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ibcs2_errno.c,v 1.4 1997/01/23 16:12:16 niklas Exp $ */ +/* $OpenBSD: ibcs2_errno.c,v 1.5 2007/10/27 22:42:10 miod Exp $ */ /* $NetBSD: ibcs2_errno.c,v 1.2 1996/05/03 17:05:16 christos Exp $ */ /* @@ -32,9 +32,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/errno.h> #include <compat/ibcs2/ibcs2_errno.h> -int bsd2ibcs_errno[] = { +int bsd2ibcs_errno[1 + ELAST] = { 0, /* 0 */ IBCS2_EPERM, /* 1 */ IBCS2_ENOENT, /* 2 */ @@ -102,19 +103,28 @@ int bsd2ibcs_errno[] = { IBCS2_EHOSTDOWN, /* 64 */ IBCS2_EHOSTUNREACH, /* 65 */ IBCS2_ENOTEMPTY, /* 66 */ - 0, /* 67 */ - 0, /* 68 */ - 0, /* 69 */ + IBCS2_ENOSYS, /* 67 unavailable? */ + IBCS2_ENOSYS, /* 68 unavailable? */ + IBCS2_ENOSYS, /* 69 unavailable? */ IBCS2_ESTALE, /* 70 */ IBCS2_EREMOTE, /* 71 */ - 0, /* 72 */ - 0, /* 73 */ - 0, /* 74 */ - 0, /* 75 */ - 0, /* 76 */ + IBCS2_ENOSYS, /* 72 unavailable? */ + IBCS2_ENOSYS, /* 73 unavailable? */ + IBCS2_ENOSYS, /* 74 unavailable? */ + IBCS2_ENOSYS, /* 75 unavailable? */ + IBCS2_ENOSYS, /* 76 unavailable? */ IBCS2_ENOLCK, /* 77 */ IBCS2_ENOSYS, /* 78 */ - 0, /* 79 */ - 0, /* 80 */ - 0, /* 81 */ + IBCS2_ENOSYS, /* 79 unavailable? */ + IBCS2_ENOSYS, /* 80 unavailable? */ + IBCS2_ENOSYS, /* 81 unavailable? */ + IBCS2_ENOSYS, /* 82 unavailable? */ + IBCS2_ENOSYS, /* 83 unavailable? */ + IBCS2_ENOSYS, /* 84 unavailable? */ + IBCS2_ENOSYS, /* 85 unavailable? */ + IBCS2_ENOSYS, /* 86 unavailable? */ + IBCS2_ENOSYS, /* 87 unavailable? */ + IBCS2_ENOSYS, /* 88 unavailable? */ + IBCS2_EIDRM, /* 89 */ + IBCS2_ENOMSG /* 90 */ }; diff --git a/sys/compat/linux/linux_error.c b/sys/compat/linux/linux_error.c index 085e6dbef8d..1296b349fa5 100644 --- a/sys/compat/linux/linux_error.c +++ b/sys/compat/linux/linux_error.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_error.c,v 1.3 2003/09/04 02:57:22 tedu Exp $ */ +/* $OpenBSD: linux_error.c,v 1.4 2007/10/27 22:42:11 miod Exp $ */ /* $NetBSD: linux_error.c,v 1.2 1995/04/22 19:48:32 christos Exp $ */ /* @@ -32,9 +32,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/errno.h> #include <compat/linux/linux_errno.h> -int linux_error[] = { +int linux_error[1 + ELAST] = { 0, -LINUX_EPERM, -LINUX_ENOENT, @@ -119,61 +120,11 @@ int linux_error[] = { -LINUX_ENOSYS, /* not mapped (ENEEDAUTH) */ -LINUX_ENOSYS, /* not mapped (EIPSEC) */ -LINUX_EOPNOTSUPP, /* what is ENOATTR? */ - - /* - * The rest of the list consists of errors that only - * Linux has. They can be used to map them on to - * themselves, so Linux emulating syscalls can return - * these values. - */ - - -LINUX_ENOMSG, - -LINUX_EIDRM, - -LINUX_ECHRNG, - -LINUX_EL2NSYNC, - -LINUX_EL3HLT, - -LINUX_EL3RST, - -LINUX_ELNRNG, - -LINUX_EUNATCH, - -LINUX_ENOCSI, - -LINUX_EL2HLT, - -LINUX_EBADE, - -LINUX_EBADR, - -LINUX_EXFULL, - -LINUX_ENOANO, - -LINUX_EBADRQC, - -LINUX_EBADSLT, - -LINUX_EDEADLOCK, - -LINUX_EBFONT, - -LINUX_ENOSTR, - -LINUX_ENODATA, - -LINUX_ETIME, - -LINUX_ENOSR, - -LINUX_ENONET, - -LINUX_ENOPKG, - -LINUX_ENOLINK, - -LINUX_EADV, - -LINUX_ESRMNT, - -LINUX_ECOMM, - -LINUX_EPROTO, - -LINUX_EMULTIHOP, - -LINUX_EDOTDOT, - -LINUX_EBADMSG, - -LINUX_EOVERFLOW, - -LINUX_ENOTUNIQ, - -LINUX_EBADFD, - -LINUX_EREMCHG, - -LINUX_ELIBACC, - -LINUX_ELIBBAD, - -LINUX_ELIBSCN, - -LINUX_ELIBMAX, - -LINUX_ELIBEXEC, -LINUX_EILSEQ, - -LINUX_ERESTART, - -LINUX_ESTRPIPE, - -LINUX_EUCLEAN, - -LINUX_ENOTNAM, - -LINUX_ENAVAIL, - -LINUX_EISNAM, - -LINUX_EREMOTEIO + -LINUX_ENOSYS, /* not mapped (ENOMEDIUM) */ + -LINUX_ENOSYS, /* not mapped (EMEDIUMTYPE) */ + -LINUX_EOVERFLOW, + -LINUX_ENOSYS, /* not mapped (ECANCELED) */ + -LINUX_EIDRM, + -LINUX_ENOMSG }; diff --git a/sys/compat/osf1/osf1_cvt_errno.c b/sys/compat/osf1/osf1_cvt_errno.c index f31b2a5a1c0..57365498579 100644 --- a/sys/compat/osf1/osf1_cvt_errno.c +++ b/sys/compat/osf1/osf1_cvt_errno.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osf1_cvt_errno.c,v 1.1 2000/08/04 15:47:54 ericj Exp $ */ +/* $OpenBSD: osf1_cvt_errno.c,v 1.2 2007/10/27 22:42:11 miod Exp $ */ /* $NetBSD: osf1_cvt_errno.c,v 1.4 1999/05/01 02:16:01 cgd Exp $ */ /* @@ -31,6 +31,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <sys/errno.h> #include <compat/osf1/osf1.h> #include <compat/osf1/osf1_cvt.h> @@ -41,7 +42,7 @@ * It is up to date as of Digital UNIX V4.0 and NetBSD 1.4. */ -const int osf1_errno_rxlist[] = { +const int osf1_errno_rxlist[1 + ELAST] = { 0, OSF1_EPERM, /* EPERM (1) -> 1 */ OSF1_ENOENT, /* ENOENT (2) -> 2 */ @@ -124,7 +125,13 @@ const int osf1_errno_rxlist[] = { OSF1_EFTYPE, /* EFTYPE (79) -> 79 */ OSF1_ENOSYS, /* EAUTH (80) has no equivalent */ OSF1_ENOSYS, /* ENEEDAUTH (81) has no equivalent */ - OSF1_EIDRM, /* EIDRM (82) -> 81 */ - OSF1_ENOMSG, /* ENOMSG (83) -> 80 */ - OSF1_EOVERFLOW, /* EOVERFLOW (84) -> 103 */ + OSF1_ENOSYS, /* EIPSEC (82) has no equivalent */ + OSF1_ENOSYS, /* ENOATTR (83) has no equivalent */ + OSF1_EILSEQ, /* EILSEQ (84) -> 116 */ + OSF1_ENOSYS, /* ENOMEDIUM (85) has no equivalent */ + OSF1_ENOSYS, /* EMEDIUMTYPE (86) has no equivalent */ + OSF1_EOVERFLOW, /* EOVERFLOW (87) -> 103 */ + OSF1_ECANCELED, /* ECANCELED (88) -> 94 */ + OSF1_EIDRM, /* EIDRM (89) -> 81 */ + OSF1_ENOMSG /* ENOMSG (90) -> 80 */ }; diff --git a/sys/compat/svr4/svr4_errno.c b/sys/compat/svr4/svr4_errno.c index 70c573b5cee..fdefb1ecf1a 100644 --- a/sys/compat/svr4/svr4_errno.c +++ b/sys/compat/svr4/svr4_errno.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_errno.c,v 1.3 2000/08/23 16:37:29 brad Exp $ */ +/* $OpenBSD: svr4_errno.c,v 1.4 2007/10/27 22:42:11 miod Exp $ */ /* $NetBSD: svr4_errno.c,v 1.7 1998/10/23 04:06:00 erh Exp $ */ /* @@ -32,10 +32,11 @@ * Translate error codes. */ +#include <sys/errno.h> #include <compat/svr4/svr4_errno.h> -int native_to_svr4_errno[] = { +int native_to_svr4_errno[1 + ELAST] = { 0, SVR4_EPERM, SVR4_ENOENT, @@ -118,4 +119,13 @@ int native_to_svr4_errno[] = { SVR4_EFTYPE, SVR4_EAUTH, SVR4_ENEEDAUTH, + SVR4_ENOSYS, /* EIPSEC */ + SVR4_ENOSYS, /* ENOATTR */ + SVR4_EILSEQ, + SVR4_ENOSYS, /* ENOMEDIUM */ + SVR4_ENOSYS, /* EMEDIUMTYPE */ + SVR4_EOVERFLOW, + SVR4_ENOSYS, /* ECANCELED */ + SVR4_EIDRM, + SVR4_ENOMSG }; |