1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

basic/errno-list: remove errno_max() and define ERRNO_MAX as 4095

In Linux kernel code, MAX_ERRNO is defined as 4095.
Here, we use that value for ERRNO_MAX.
This commit is contained in:
Yu Watanabe 2017-11-11 21:26:10 +09:00
parent f332611abe
commit 1850d0d271
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,3 @@ int errno_from_name(const char *name) {
assert(sc->id > 0);
return sc->id;
}
int errno_max(void) {
return ELEMENTSOF(errno_names);
}

View File

@ -19,7 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
/*
* MAX_ERRNO is defined as 4095 in linux/err.h
* We use the same value here.
*/
#define ERRNO_MAX 4095
const char *errno_to_name(int id);
int errno_from_name(const char *name);
int errno_max(void);