xref: /freebsd/sys/compat/linux/linux_errno.inc (revision 1ac2776bbb79d5a653d62a1db6ae67cd8ddc909d)
1*1ac2776bSEd Maste/*-
2*1ac2776bSEd Maste * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3*1ac2776bSEd Maste *
4*1ac2776bSEd Maste * Copyright (c) 1994-1996 Søren Schmidt
5*1ac2776bSEd Maste * All rights reserved.
6*1ac2776bSEd Maste *
7*1ac2776bSEd Maste * Redistribution and use in source and binary forms, with or without
8*1ac2776bSEd Maste * modification, are permitted provided that the following conditions
9*1ac2776bSEd Maste * are met:
10*1ac2776bSEd Maste * 1. Redistributions of source code must retain the above copyright
11*1ac2776bSEd Maste *    notice, this list of conditions and the following disclaimer.
12*1ac2776bSEd Maste * 2. Redistributions in binary form must reproduce the above copyright
13*1ac2776bSEd Maste *    notice, this list of conditions and the following disclaimer in the
14*1ac2776bSEd Maste *    documentation and/or other materials provided with the distribution.
15*1ac2776bSEd Maste *
16*1ac2776bSEd Maste * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17*1ac2776bSEd Maste * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*1ac2776bSEd Maste * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*1ac2776bSEd Maste * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20*1ac2776bSEd Maste * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*1ac2776bSEd Maste * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*1ac2776bSEd Maste * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*1ac2776bSEd Maste * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*1ac2776bSEd Maste * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*1ac2776bSEd Maste * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*1ac2776bSEd Maste * SUCH DAMAGE.
27*1ac2776bSEd Maste *
28*1ac2776bSEd Maste * $FreeBSD$
29*1ac2776bSEd Maste */
30*1ac2776bSEd Maste
31*1ac2776bSEd Maste/*
32*1ac2776bSEd Maste * Linux syscalls return negative errno's, we do positive and map them
33*1ac2776bSEd Maste * Reference:
34*1ac2776bSEd Maste *   FreeBSD: src/sys/sys/errno.h
35*1ac2776bSEd Maste *   Linux:   include/uapi/asm-generic/errno-base.h
36*1ac2776bSEd Maste *            include/uapi/asm-generic/errno.h
37*1ac2776bSEd Maste */
38*1ac2776bSEd Masteconst int linux_errtbl[ELAST + 1] = {
39*1ac2776bSEd Maste	-0,
40*1ac2776bSEd Maste	-1,
41*1ac2776bSEd Maste	-2,
42*1ac2776bSEd Maste	-3,
43*1ac2776bSEd Maste	-4,
44*1ac2776bSEd Maste	-5,
45*1ac2776bSEd Maste	-6,
46*1ac2776bSEd Maste	-7,
47*1ac2776bSEd Maste	-8,
48*1ac2776bSEd Maste	-9,
49*1ac2776bSEd Maste
50*1ac2776bSEd Maste	-10,
51*1ac2776bSEd Maste	-35,	/* EDEADLK */
52*1ac2776bSEd Maste	-12,
53*1ac2776bSEd Maste	-13,
54*1ac2776bSEd Maste	-14,
55*1ac2776bSEd Maste	-15,
56*1ac2776bSEd Maste	-16,
57*1ac2776bSEd Maste	-17,
58*1ac2776bSEd Maste	-18,
59*1ac2776bSEd Maste	-19,
60*1ac2776bSEd Maste
61*1ac2776bSEd Maste	-20,
62*1ac2776bSEd Maste	-21,
63*1ac2776bSEd Maste	-22,
64*1ac2776bSEd Maste	-23,
65*1ac2776bSEd Maste	-24,
66*1ac2776bSEd Maste	-25,
67*1ac2776bSEd Maste	-26,
68*1ac2776bSEd Maste	-27,
69*1ac2776bSEd Maste	-28,
70*1ac2776bSEd Maste	-29,
71*1ac2776bSEd Maste
72*1ac2776bSEd Maste	-30,
73*1ac2776bSEd Maste	-31,
74*1ac2776bSEd Maste	-32,
75*1ac2776bSEd Maste	-33,
76*1ac2776bSEd Maste	-34,
77*1ac2776bSEd Maste	-11,	/* EAGAIN */
78*1ac2776bSEd Maste	-115,
79*1ac2776bSEd Maste	-114,
80*1ac2776bSEd Maste	-88,
81*1ac2776bSEd Maste	-89,
82*1ac2776bSEd Maste
83*1ac2776bSEd Maste	-90,
84*1ac2776bSEd Maste	-91,
85*1ac2776bSEd Maste	-92,
86*1ac2776bSEd Maste	-93,
87*1ac2776bSEd Maste	-94,
88*1ac2776bSEd Maste	-95,
89*1ac2776bSEd Maste	-96,
90*1ac2776bSEd Maste	-97,
91*1ac2776bSEd Maste	-98,
92*1ac2776bSEd Maste	-99,
93*1ac2776bSEd Maste
94*1ac2776bSEd Maste	-100,
95*1ac2776bSEd Maste	-101,
96*1ac2776bSEd Maste	-102,
97*1ac2776bSEd Maste	-103,
98*1ac2776bSEd Maste	-104,
99*1ac2776bSEd Maste	-105,
100*1ac2776bSEd Maste	-106,
101*1ac2776bSEd Maste	-107,
102*1ac2776bSEd Maste	-108,
103*1ac2776bSEd Maste	-109,
104*1ac2776bSEd Maste
105*1ac2776bSEd Maste	-110,
106*1ac2776bSEd Maste	-111,
107*1ac2776bSEd Maste	-40,
108*1ac2776bSEd Maste	-36,
109*1ac2776bSEd Maste	-112,
110*1ac2776bSEd Maste	-113,
111*1ac2776bSEd Maste	-39,
112*1ac2776bSEd Maste	-11,
113*1ac2776bSEd Maste	-87,
114*1ac2776bSEd Maste	-122,
115*1ac2776bSEd Maste
116*1ac2776bSEd Maste	-116,
117*1ac2776bSEd Maste	-66,
118*1ac2776bSEd Maste	-6,	/* EBADRPC -> ENXIO */
119*1ac2776bSEd Maste	-6,	/* ERPCMISMATCH -> ENXIO */
120*1ac2776bSEd Maste	-6,	/* EPROGUNAVAIL -> ENXIO */
121*1ac2776bSEd Maste	-6,	/* EPROGMISMATCH -> ENXIO */
122*1ac2776bSEd Maste	-6,	/* EPROCUNAVAIL -> ENXIO */
123*1ac2776bSEd Maste	-37,
124*1ac2776bSEd Maste	-38,
125*1ac2776bSEd Maste	-9,
126*1ac2776bSEd Maste
127*1ac2776bSEd Maste	-6,	/* EAUTH -> ENXIO */
128*1ac2776bSEd Maste	-6,	/* ENEEDAUTH -> ENXIO */
129*1ac2776bSEd Maste	-43,
130*1ac2776bSEd Maste	-42,
131*1ac2776bSEd Maste	-75,
132*1ac2776bSEd Maste	-125,
133*1ac2776bSEd Maste	-84,
134*1ac2776bSEd Maste	-61,
135*1ac2776bSEd Maste	-16,	/* EDOOFUS -> EBUSY */
136*1ac2776bSEd Maste	-74,
137*1ac2776bSEd Maste
138*1ac2776bSEd Maste	-72,
139*1ac2776bSEd Maste	-67,
140*1ac2776bSEd Maste	-71,
141*1ac2776bSEd Maste	-1,	/* ENOTCAPABLE -> EPERM */
142*1ac2776bSEd Maste	-1,	/* ECAPMODE -> EPERM */
143*1ac2776bSEd Maste	-131,	/* ENOTRECOVERABLE */
144*1ac2776bSEd Maste	-130,	/* EOWNERDEAD */
145*1ac2776bSEd Maste};
146*1ac2776bSEd Maste
147*1ac2776bSEd Maste_Static_assert(ELAST == 96,
148*1ac2776bSEd Maste    "missing errno entries in linux_errtbl");
149