The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/linux/linux_errno.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* $FreeBSD$ */
    2 
    3 #include <sys/cdefs.h>
    4 __FBSDID("$FreeBSD$");
    5 
    6 #include <sys/param.h>
    7 #include <sys/errno.h>
    8 #include <sys/systm.h>
    9 
   10 #include <compat/linux/linux.h>
   11 #include <compat/linux/linux_errno.h>
   12 #include <compat/linux/linux_errno.inc>
   13 
   14 int
   15 bsd_to_linux_errno(int error)
   16 {
   17 
   18         KASSERT(error >= 0 && error <= ELAST,
   19             ("%s: bad error %d", __func__, error));
   20 
   21         return (linux_errtbl[error]);
   22 }
   23 
   24 #ifdef INVARIANTS
   25 void
   26 linux_check_errtbl(void)
   27 {
   28         int i;
   29 
   30         for (i = 1; i < nitems(linux_errtbl); i++) {
   31                 KASSERT(linux_errtbl[i] != 0,
   32                     ("%s: linux_errtbl[%d] == 0", __func__, i));
   33         }
   34 
   35         for (i = 1; i < nitems(linux_to_bsd_errtbl); i++) {
   36                 KASSERT(linux_to_bsd_errtbl[i] != 0,
   37                     ("%s: linux_to_bsd_errtbl[%d] == 0", __func__, i));
   38         }
   39 
   40 }
   41 #endif

Cache object: cdecbc919959704b03439f4cde3a0d56


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.