basic: introduce *_to_string_with_check() functions
They are used in later commits.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#include <stdbool.h>
|
||||
/*
|
||||
* MAX_ERRNO is defined as 4095 in linux/err.h
|
||||
* We use the same value here.
|
||||
@@ -28,3 +29,6 @@
|
||||
|
||||
const char *errno_to_name(int id);
|
||||
int errno_from_name(const char *name);
|
||||
static inline bool errno_is_valid(int n) {
|
||||
return n > 0 && n <= ERRNO_MAX;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user