Home | History | Annotate | Line # | Download | only in common
linux_errno.c revision 1.10
      1  1.10  jdolecek /*	$NetBSD: linux_errno.c,v 1.10 2001/01/18 20:28:27 jdolecek Exp $	*/
      2   1.1      fvdl 
      3   1.7      fvdl /*-
      4   1.7      fvdl  * Copyright (c) 1995 The NetBSD Foundation, Inc.
      5   1.1      fvdl  * All rights reserved.
      6   1.1      fvdl  *
      7   1.7      fvdl  * This code is derived from software contributed to The NetBSD Foundation
      8   1.7      fvdl  * by Frank van der Linden.
      9   1.7      fvdl  *
     10   1.1      fvdl  * Redistribution and use in source and binary forms, with or without
     11   1.1      fvdl  * modification, are permitted provided that the following conditions
     12   1.1      fvdl  * are met:
     13   1.1      fvdl  * 1. Redistributions of source code must retain the above copyright
     14   1.1      fvdl  *    notice, this list of conditions and the following disclaimer.
     15   1.1      fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1      fvdl  *    notice, this list of conditions and the following disclaimer in the
     17   1.1      fvdl  *    documentation and/or other materials provided with the distribution.
     18   1.1      fvdl  * 3. All advertising materials mentioning features or use of this software
     19   1.1      fvdl  *    must display the following acknowledgement:
     20   1.7      fvdl  *	This product includes software developed by the NetBSD
     21   1.7      fvdl  *	Foundation, Inc. and its contributors.
     22   1.7      fvdl  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23   1.7      fvdl  *    contributors may be used to endorse or promote products derived
     24   1.7      fvdl  *    from this software without specific prior written permission.
     25   1.1      fvdl  *
     26   1.7      fvdl  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27   1.7      fvdl  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28   1.7      fvdl  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29   1.7      fvdl  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30   1.7      fvdl  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31   1.7      fvdl  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32   1.7      fvdl  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33   1.7      fvdl  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34   1.7      fvdl  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35   1.7      fvdl  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36   1.7      fvdl  * POSSIBILITY OF SUCH DAMAGE.
     37   1.1      fvdl  */
     38   1.1      fvdl 
     39   1.6  christos #include <compat/linux/common/linux_errno.h>
     40   1.1      fvdl 
     41   1.5       erh /*
     42   1.9       erh  * This list is used to translate NetBSD errnos to linux errnos
     43   1.5       erh  * when returning from a system call. (NetBSD system call->linux program)
     44   1.5       erh  */
     45  1.10  jdolecek const int native_to_linux_errno[] = {
     46   1.1      fvdl 	0,
     47   1.2  christos 	-LINUX_EPERM,
     48   1.2  christos 	-LINUX_ENOENT,
     49   1.2  christos 	-LINUX_ESRCH,
     50   1.2  christos 	-LINUX_EINTR,
     51   1.2  christos 	-LINUX_EIO,
     52   1.2  christos 	-LINUX_ENXIO,
     53   1.2  christos 	-LINUX_E2BIG,
     54   1.2  christos 	-LINUX_ENOEXEC,
     55   1.2  christos 	-LINUX_EBADF,
     56   1.2  christos 	-LINUX_ECHILD,
     57   1.2  christos 	-LINUX_EDEADLK,
     58   1.2  christos 	-LINUX_ENOMEM,
     59   1.2  christos 	-LINUX_EACCES,
     60   1.2  christos 	-LINUX_EFAULT,
     61   1.2  christos 	-LINUX_ENOTBLK,
     62   1.2  christos 	-LINUX_EBUSY,
     63   1.2  christos 	-LINUX_EEXIST,
     64   1.2  christos 	-LINUX_EXDEV,
     65   1.2  christos 	-LINUX_ENODEV,
     66   1.2  christos 	-LINUX_ENOTDIR,
     67   1.2  christos 	-LINUX_EISDIR,
     68   1.2  christos 	-LINUX_EINVAL,
     69   1.2  christos 	-LINUX_ENFILE,
     70   1.2  christos 	-LINUX_EMFILE,
     71   1.2  christos 	-LINUX_ENOTTY,
     72   1.2  christos 	-LINUX_ETXTBSY,
     73   1.2  christos 	-LINUX_EFBIG,
     74   1.2  christos 	-LINUX_ENOSPC,
     75   1.2  christos 	-LINUX_ESPIPE,
     76   1.2  christos 	-LINUX_EROFS,
     77   1.2  christos 	-LINUX_EMLINK,
     78   1.2  christos 	-LINUX_EPIPE,
     79   1.2  christos 	-LINUX_EDOM,
     80   1.2  christos 	-LINUX_ERANGE,
     81   1.2  christos 	-LINUX_EAGAIN,
     82   1.2  christos 	-LINUX_EINPROGRESS,
     83   1.2  christos 	-LINUX_EALREADY,
     84   1.2  christos 	-LINUX_ENOTSOCK,
     85   1.2  christos 	-LINUX_EDESTADDRREQ,
     86   1.2  christos 	-LINUX_EMSGSIZE,
     87   1.2  christos 	-LINUX_EPROTOTYPE,
     88   1.2  christos 	-LINUX_ENOPROTOOPT,
     89   1.2  christos 	-LINUX_EPROTONOSUPPORT,
     90   1.2  christos 	-LINUX_ESOCKTNOSUPPORT,
     91   1.2  christos 	-LINUX_EOPNOTSUPP,
     92   1.2  christos 	-LINUX_EPFNOSUPPORT,
     93   1.2  christos 	-LINUX_EAFNOSUPPORT,
     94   1.2  christos 	-LINUX_EADDRINUSE,
     95   1.2  christos 	-LINUX_EADDRNOTAVAIL,
     96   1.2  christos 	-LINUX_ENETDOWN,
     97   1.2  christos 	-LINUX_ENETUNREACH,
     98   1.2  christos 	-LINUX_ENETRESET,
     99   1.2  christos 	-LINUX_ECONNABORTED,
    100   1.2  christos 	-LINUX_ECONNRESET,
    101   1.2  christos 	-LINUX_ENOBUFS,
    102   1.2  christos 	-LINUX_EISCONN,
    103   1.2  christos 	-LINUX_ENOTCONN,
    104   1.2  christos 	-LINUX_ESHUTDOWN,
    105   1.2  christos 	-LINUX_ETOOMANYREFS,
    106   1.2  christos 	-LINUX_ETIMEDOUT,
    107   1.2  christos 	-LINUX_ECONNREFUSED,
    108   1.2  christos 	-LINUX_ELOOP,
    109   1.2  christos 	-LINUX_ENAMETOOLONG,
    110   1.2  christos 	-LINUX_EHOSTDOWN,
    111   1.2  christos 	-LINUX_EHOSTUNREACH,
    112   1.2  christos 	-LINUX_ENOTEMPTY,
    113   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EPROCLIM) */
    114   1.2  christos 	-LINUX_EUSERS,
    115   1.2  christos 	-LINUX_EDQUOT,
    116   1.2  christos 	-LINUX_ESTALE,
    117   1.2  christos 	-LINUX_EREMOTE,
    118   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EBADRPC) */
    119   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (ERPCMISMATCH) */
    120   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EPROGUNAVAIL) */
    121   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EPROGMISMATCH) */
    122   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EPROCUNAVAIL) */
    123   1.2  christos 	-LINUX_ENOLCK,
    124   1.2  christos 	-LINUX_ENOSYS,
    125   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EFTYPE) */
    126   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (EAUTH) */
    127   1.2  christos 	-LINUX_ENOSYS,		/* not mapped (ENEEDAUTH) */
    128   1.3     mikel 	-LINUX_EIDRM,
    129   1.5       erh 	-LINUX_ENOMSG,		/* 83 */
    130   1.1      fvdl 
    131   1.1      fvdl 	/*
    132   1.1      fvdl 	 * The rest of the list consists of errors that only
    133   1.1      fvdl 	 * Linux has. They can be used to map them on to
    134   1.1      fvdl 	 * themselves, so Linux emulating syscalls can return
    135   1.1      fvdl 	 * these values.
    136   1.1      fvdl 	 */
    137   1.1      fvdl 
    138   1.2  christos 	-LINUX_ECHRNG,
    139   1.2  christos 	-LINUX_EL2NSYNC,
    140   1.2  christos 	-LINUX_EL3HLT,
    141   1.2  christos 	-LINUX_EL3RST,
    142   1.2  christos 	-LINUX_ELNRNG,
    143   1.2  christos 	-LINUX_EUNATCH,
    144   1.2  christos 	-LINUX_ENOCSI,
    145   1.2  christos 	-LINUX_EL2HLT,
    146   1.2  christos 	-LINUX_EBADE,
    147   1.2  christos 	-LINUX_EBADR,
    148   1.2  christos 	-LINUX_EXFULL,
    149   1.2  christos 	-LINUX_ENOANO,
    150   1.2  christos 	-LINUX_EBADRQC,
    151   1.2  christos 	-LINUX_EBADSLT,
    152   1.2  christos 	-LINUX_EDEADLOCK,
    153   1.2  christos 	-LINUX_EBFONT,
    154   1.2  christos 	-LINUX_ENOSTR,
    155   1.2  christos 	-LINUX_ENODATA,
    156   1.2  christos 	-LINUX_ETIME,
    157   1.2  christos 	-LINUX_ENOSR,
    158   1.2  christos 	-LINUX_ENONET,
    159   1.2  christos 	-LINUX_ENOPKG,
    160   1.2  christos 	-LINUX_ENOLINK,
    161   1.2  christos 	-LINUX_EADV,
    162   1.2  christos 	-LINUX_ESRMNT,
    163   1.2  christos 	-LINUX_ECOMM,
    164   1.2  christos 	-LINUX_EPROTO,
    165   1.2  christos 	-LINUX_EMULTIHOP,
    166   1.2  christos 	-LINUX_EDOTDOT,
    167   1.2  christos 	-LINUX_EBADMSG,
    168   1.2  christos 	-LINUX_EOVERFLOW,
    169   1.2  christos 	-LINUX_ENOTUNIQ,
    170   1.2  christos 	-LINUX_EBADFD,
    171   1.2  christos 	-LINUX_EREMCHG,
    172   1.2  christos 	-LINUX_ELIBACC,
    173   1.2  christos 	-LINUX_ELIBBAD,
    174   1.2  christos 	-LINUX_ELIBSCN,
    175   1.2  christos 	-LINUX_ELIBMAX,
    176   1.2  christos 	-LINUX_ELIBEXEC,
    177   1.2  christos 	-LINUX_EILSEQ,
    178   1.2  christos 	-LINUX_ERESTART,
    179   1.2  christos 	-LINUX_ESTRPIPE,
    180   1.2  christos 	-LINUX_EUCLEAN,
    181   1.2  christos 	-LINUX_ENOTNAM,
    182   1.2  christos 	-LINUX_ENAVAIL,
    183   1.2  christos 	-LINUX_EISNAM,
    184   1.5       erh 	-LINUX_EREMOTEIO,
    185   1.1      fvdl };
    186