chiark / gitweb /
tree-wide: drop license boilerplate
[elogind.git] / src / basic / errno-list.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   This file is part of systemd.
6
7   Copyright 2013 Lennart Poettering
8 ***/
9
10 #include <stdbool.h>
11 /*
12  * MAX_ERRNO is defined as 4095 in linux/err.h
13  * We use the same value here.
14  */
15 #define ERRNO_MAX 4095
16
17 const char *errno_to_name(int id);
18 int errno_from_name(const char *name);
19 static inline bool errno_is_valid(int n) {
20         return n > 0 && n <= ERRNO_MAX;
21 }