xref: /freebsd/sys/compat/linux/linux_errno.inc (revision 38be3127061c92eaf648f84be4042ba49484dcde)
11ac2776bSEd Maste/*-
21ac2776bSEd Maste * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
31ac2776bSEd Maste *
41ac2776bSEd Maste * Copyright (c) 1994-1996 Søren Schmidt
51ac2776bSEd Maste * All rights reserved.
61ac2776bSEd Maste *
71ac2776bSEd Maste * Redistribution and use in source and binary forms, with or without
81ac2776bSEd Maste * modification, are permitted provided that the following conditions
91ac2776bSEd Maste * are met:
101ac2776bSEd Maste * 1. Redistributions of source code must retain the above copyright
111ac2776bSEd Maste *    notice, this list of conditions and the following disclaimer.
121ac2776bSEd Maste * 2. Redistributions in binary form must reproduce the above copyright
131ac2776bSEd Maste *    notice, this list of conditions and the following disclaimer in the
141ac2776bSEd Maste *    documentation and/or other materials provided with the distribution.
151ac2776bSEd Maste *
161ac2776bSEd Maste * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
171ac2776bSEd Maste * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
181ac2776bSEd Maste * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191ac2776bSEd Maste * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
201ac2776bSEd Maste * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
211ac2776bSEd Maste * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
221ac2776bSEd Maste * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
231ac2776bSEd Maste * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
241ac2776bSEd Maste * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
251ac2776bSEd Maste * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261ac2776bSEd Maste * SUCH DAMAGE.
271ac2776bSEd Maste *
281ac2776bSEd Maste * $FreeBSD$
291ac2776bSEd Maste */
301ac2776bSEd Maste
311ac2776bSEd Maste/*
321ac2776bSEd Maste * Linux syscalls return negative errno's, we do positive and map them
331ac2776bSEd Maste * Reference:
341ac2776bSEd Maste *   FreeBSD: src/sys/sys/errno.h
351ac2776bSEd Maste *   Linux:   include/uapi/asm-generic/errno-base.h
361ac2776bSEd Maste *            include/uapi/asm-generic/errno.h
371ac2776bSEd Maste */
381ac2776bSEd Masteconst int linux_errtbl[ELAST + 1] = {
391ac2776bSEd Maste	-0,
401ac2776bSEd Maste	-1,
411ac2776bSEd Maste	-2,
421ac2776bSEd Maste	-3,
431ac2776bSEd Maste	-4,
441ac2776bSEd Maste	-5,
451ac2776bSEd Maste	-6,
461ac2776bSEd Maste	-7,
471ac2776bSEd Maste	-8,
481ac2776bSEd Maste	-9,
491ac2776bSEd Maste
501ac2776bSEd Maste	-10,
511ac2776bSEd Maste	-35,	/* EDEADLK */
521ac2776bSEd Maste	-12,
531ac2776bSEd Maste	-13,
541ac2776bSEd Maste	-14,
551ac2776bSEd Maste	-15,
561ac2776bSEd Maste	-16,
571ac2776bSEd Maste	-17,
581ac2776bSEd Maste	-18,
591ac2776bSEd Maste	-19,
601ac2776bSEd Maste
611ac2776bSEd Maste	-20,
621ac2776bSEd Maste	-21,
631ac2776bSEd Maste	-22,
641ac2776bSEd Maste	-23,
651ac2776bSEd Maste	-24,
661ac2776bSEd Maste	-25,
671ac2776bSEd Maste	-26,
681ac2776bSEd Maste	-27,
691ac2776bSEd Maste	-28,
701ac2776bSEd Maste	-29,
711ac2776bSEd Maste
721ac2776bSEd Maste	-30,
731ac2776bSEd Maste	-31,
741ac2776bSEd Maste	-32,
751ac2776bSEd Maste	-33,
761ac2776bSEd Maste	-34,
771ac2776bSEd Maste	-11,	/* EAGAIN */
781ac2776bSEd Maste	-115,
791ac2776bSEd Maste	-114,
801ac2776bSEd Maste	-88,
811ac2776bSEd Maste	-89,
821ac2776bSEd Maste
831ac2776bSEd Maste	-90,
841ac2776bSEd Maste	-91,
851ac2776bSEd Maste	-92,
861ac2776bSEd Maste	-93,
871ac2776bSEd Maste	-94,
881ac2776bSEd Maste	-95,
891ac2776bSEd Maste	-96,
901ac2776bSEd Maste	-97,
911ac2776bSEd Maste	-98,
921ac2776bSEd Maste	-99,
931ac2776bSEd Maste
941ac2776bSEd Maste	-100,
951ac2776bSEd Maste	-101,
961ac2776bSEd Maste	-102,
971ac2776bSEd Maste	-103,
981ac2776bSEd Maste	-104,
991ac2776bSEd Maste	-105,
1001ac2776bSEd Maste	-106,
1011ac2776bSEd Maste	-107,
1021ac2776bSEd Maste	-108,
1031ac2776bSEd Maste	-109,
1041ac2776bSEd Maste
1051ac2776bSEd Maste	-110,
1061ac2776bSEd Maste	-111,
1071ac2776bSEd Maste	-40,
1081ac2776bSEd Maste	-36,
1091ac2776bSEd Maste	-112,
1101ac2776bSEd Maste	-113,
1111ac2776bSEd Maste	-39,
1121ac2776bSEd Maste	-11,
1131ac2776bSEd Maste	-87,
1141ac2776bSEd Maste	-122,
1151ac2776bSEd Maste
1161ac2776bSEd Maste	-116,
1171ac2776bSEd Maste	-66,
1181ac2776bSEd Maste	-6,	/* EBADRPC -> ENXIO */
1191ac2776bSEd Maste	-6,	/* ERPCMISMATCH -> ENXIO */
1201ac2776bSEd Maste	-6,	/* EPROGUNAVAIL -> ENXIO */
1211ac2776bSEd Maste	-6,	/* EPROGMISMATCH -> ENXIO */
1221ac2776bSEd Maste	-6,	/* EPROCUNAVAIL -> ENXIO */
1231ac2776bSEd Maste	-37,
1241ac2776bSEd Maste	-38,
1251ac2776bSEd Maste	-9,
1261ac2776bSEd Maste
1271ac2776bSEd Maste	-6,	/* EAUTH -> ENXIO */
1281ac2776bSEd Maste	-6,	/* ENEEDAUTH -> ENXIO */
1291ac2776bSEd Maste	-43,
1301ac2776bSEd Maste	-42,
1311ac2776bSEd Maste	-75,
1321ac2776bSEd Maste	-125,
1331ac2776bSEd Maste	-84,
1341ac2776bSEd Maste	-61,
135*38be3127SEd Maste	-22,	/* EDOOFUS -> EINVAL */
1361ac2776bSEd Maste	-74,
1371ac2776bSEd Maste
1381ac2776bSEd Maste	-72,
1391ac2776bSEd Maste	-67,
1401ac2776bSEd Maste	-71,
1411ac2776bSEd Maste	-1,	/* ENOTCAPABLE -> EPERM */
1421ac2776bSEd Maste	-1,	/* ECAPMODE -> EPERM */
1431ac2776bSEd Maste	-131,	/* ENOTRECOVERABLE */
1441ac2776bSEd Maste	-130,	/* EOWNERDEAD */
1451ac2776bSEd Maste};
1461ac2776bSEd Maste
1471ac2776bSEd Maste_Static_assert(ELAST == 96,
1481ac2776bSEd Maste    "missing errno entries in linux_errtbl");
149