2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2013-11-22 04:01:46 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-12-29 09:03:54 +01:00
|
|
|
#include <stdbool.h>
|
2017-11-11 13:26:10 +01:00
|
|
|
/*
|
|
|
|
* MAX_ERRNO is defined as 4095 in linux/err.h
|
|
|
|
* We use the same value here.
|
|
|
|
*/
|
|
|
|
#define ERRNO_MAX 4095
|
|
|
|
|
2013-11-22 04:01:46 +01:00
|
|
|
const char *errno_to_name(int id);
|
|
|
|
int errno_from_name(const char *name);
|
2017-12-29 09:03:54 +01:00
|
|
|
static inline bool errno_is_valid(int n) {
|
|
|
|
return n > 0 && n <= ERRNO_MAX;
|
|
|
|
}
|