linux_errno.c: add newer errno values

Also introduce a static assert to ensure the list is kept up to date.

Sponsored by:	Turing Robotic Industries Inc.
This commit is contained in:
Ed Maste 2018-03-16 14:51:47 +00:00
parent 6e481f83f7
commit d595c5c0d6

View File

@ -28,14 +28,15 @@
* $FreeBSD$
*/
#include <sys/cdefs.h>
#include <sys/errno.h>
/*
* Linux syscalls return negative errno's, we do positive and map them
* Reference:
* FreeBSD: src/sys/sys/errno.h
* Linux: linux-2.6.17.8/include/asm-generic/errno-base.h
* linux-2.6.17.8/include/asm-generic/errno.h
* Linux: include/uapi/asm-generic/errno-base.h
* include/uapi/asm-generic/errno.h
*/
const int bsd_to_linux_errno_generic[ELAST + 1] = {
-0,
@ -140,4 +141,11 @@ const int bsd_to_linux_errno_generic[ELAST + 1] = {
-72,
-67,
-71,
-1, /* ENOTCAPABLE -> EPERM */
-1, /* ECAPMODE -> EPERM */
-131, /* ENOTRECOVERABLE */
-130, /* EOWNERDEAD */
};
_Static_assert(ELAST == 96,
"missing errno entries in bsd_to_linux_errno_generic");