aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_errno.c
blob: 6e9119a5fadca84bf1ab49916cac01d483100109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright (c) 2015-2018 Linaro Limited
 */

#include <odp/api/errno.h>
#include <string.h>
#include <stdio.h>
#include <odp_debug_internal.h>

__thread int _odp_errno;

int odp_errno(void)
{
	return _odp_errno;
}

void odp_errno_zero(void)
{
	_odp_errno = 0;
}

void odp_errno_print(const char *str)
{
	if (str != NULL)
		_ODP_PRINT("%s %s\n", str, strerror(_odp_errno));
	else
		_ODP_PRINT("%s\n", strerror(_odp_errno));
}

const char *odp_errno_str(int errnum)
{
	return strerror(errnum);
}