]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/errno-list.h
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / src / basic / errno-list.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
780896a4
LP
2#pragma once
3
4/***
780896a4 5 Copyright 2013 Lennart Poettering
780896a4
LP
6***/
7
33d12153 8#include <stdbool.h>
1850d0d2
YW
9/*
10 * MAX_ERRNO is defined as 4095 in linux/err.h
11 * We use the same value here.
12 */
13#define ERRNO_MAX 4095
14
780896a4
LP
15const char *errno_to_name(int id);
16int errno_from_name(const char *name);
33d12153
YW
17static inline bool errno_is_valid(int n) {
18 return n > 0 && n <= ERRNO_MAX;
19}