aboutsummaryrefslogblamecommitdiffstats
path: root/consts.c
blob: 9a7e3fbc6434711fdb7c28b802f42a13ff420925 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                         
/* See LICENSE file for copyright and license details. */
#include "common.h"


const char *
get_errno_name(int err)
{
	static char buf[3 * sizeof(err) + 2];

#define X(N) if (err == N) return #N;
	LIST_ERRNOS(X)
#undef X

	sprintf(buf, "%i", err);
	return buf;
}