linux_errno.inc revision 331056
1331056Semaste/*-
2331056Semaste * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3331056Semaste *
4331056Semaste * Copyright (c) 1994-1996 Sren Schmidt
5331056Semaste * All rights reserved.
6331056Semaste *
7331056Semaste * Redistribution and use in source and binary forms, with or without
8331056Semaste * modification, are permitted provided that the following conditions
9331056Semaste * are met:
10331056Semaste * 1. Redistributions of source code must retain the above copyright
11331056Semaste *    notice, this list of conditions and the following disclaimer.
12331056Semaste * 2. Redistributions in binary form must reproduce the above copyright
13331056Semaste *    notice, this list of conditions and the following disclaimer in the
14331056Semaste *    documentation and/or other materials provided with the distribution.
15331056Semaste *
16331056Semaste * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17331056Semaste * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18331056Semaste * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19331056Semaste * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20331056Semaste * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21331056Semaste * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22331056Semaste * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23331056Semaste * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24331056Semaste * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25331056Semaste * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26331056Semaste * SUCH DAMAGE.
27331056Semaste *
28331056Semaste * $FreeBSD: head/sys/compat/linux/linux_errno.c 331056 2018-03-16 14:46:38Z emaste $
29331056Semaste */
30331056Semaste
31331056Semaste#include <sys/errno.h>
32331056Semaste
33331056Semaste/*
34331056Semaste * Linux syscalls return negative errno's, we do positive and map them
35331056Semaste * Reference:
36331056Semaste *   FreeBSD: src/sys/sys/errno.h
37331056Semaste *   Linux:   linux-2.6.17.8/include/asm-generic/errno-base.h
38331056Semaste *            linux-2.6.17.8/include/asm-generic/errno.h
39331056Semaste */
40331056Semasteconst int bsd_to_linux_errno_generic[ELAST + 1] = {
41331056Semaste	-0,
42331056Semaste	-1,
43331056Semaste	-2,
44331056Semaste	-3,
45331056Semaste	-4,
46331056Semaste	-5,
47331056Semaste	-6,
48331056Semaste	-7,
49331056Semaste	-8,
50331056Semaste	-9,
51331056Semaste
52331056Semaste	-10,
53331056Semaste	-35,	/* EDEADLK */
54331056Semaste	-12,
55331056Semaste	-13,
56331056Semaste	-14,
57331056Semaste	-15,
58331056Semaste	-16,
59331056Semaste	-17,
60331056Semaste	-18,
61331056Semaste	-19,
62331056Semaste
63331056Semaste	-20,
64331056Semaste	-21,
65331056Semaste	-22,
66331056Semaste	-23,
67331056Semaste	-24,
68331056Semaste	-25,
69331056Semaste	-26,
70331056Semaste	-27,
71331056Semaste	-28,
72331056Semaste	-29,
73331056Semaste
74331056Semaste	-30,
75331056Semaste	-31,
76331056Semaste	-32,
77331056Semaste	-33,
78331056Semaste	-34,
79331056Semaste	-11,	/* EAGAIN */
80331056Semaste	-115,
81331056Semaste	-114,
82331056Semaste	-88,
83331056Semaste	-89,
84331056Semaste
85331056Semaste	-90,
86331056Semaste	-91,
87331056Semaste	-92,
88331056Semaste	-93,
89331056Semaste	-94,
90331056Semaste	-95,
91331056Semaste	-96,
92331056Semaste	-97,
93331056Semaste	-98,
94331056Semaste	-99,
95331056Semaste
96331056Semaste	-100,
97331056Semaste	-101,
98331056Semaste	-102,
99331056Semaste	-103,
100331056Semaste	-104,
101331056Semaste	-105,
102331056Semaste	-106,
103331056Semaste	-107,
104331056Semaste	-108,
105331056Semaste	-109,
106331056Semaste
107331056Semaste	-110,
108331056Semaste	-111,
109331056Semaste	-40,
110331056Semaste	-36,
111331056Semaste	-112,
112331056Semaste	-113,
113331056Semaste	-39,
114331056Semaste	-11,
115331056Semaste	-87,
116331056Semaste	-122,
117331056Semaste
118331056Semaste	-116,
119331056Semaste	-66,
120331056Semaste	-6,	/* EBADRPC -> ENXIO */
121331056Semaste	-6,	/* ERPCMISMATCH -> ENXIO */
122331056Semaste	-6,	/* EPROGUNAVAIL -> ENXIO */
123331056Semaste	-6,	/* EPROGMISMATCH -> ENXIO */
124331056Semaste	-6,	/* EPROCUNAVAIL -> ENXIO */
125331056Semaste	-37,
126331056Semaste	-38,
127331056Semaste	-9,
128331056Semaste
129331056Semaste	-6,	/* EAUTH -> ENXIO */
130331056Semaste	-6,	/* ENEEDAUTH -> ENXIO */
131331056Semaste	-43,
132331056Semaste	-42,
133331056Semaste	-75,
134331056Semaste	-125,
135331056Semaste	-84,
136331056Semaste	-61,
137331056Semaste	-16,	/* EDOOFUS -> EBUSY */
138331056Semaste	-74,
139331056Semaste
140331056Semaste	-72,
141331056Semaste	-67,
142331056Semaste	-71,
143331056Semaste};
144