aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_errno.c
blob: 1a76d4366ea7d31599382ec8ec46490bcb361211 (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
34
35
36
/* Copyright (c) 2015, Linaro Limited
 * All rights reserved.
 *
 * SPDX-License-Identifier:	BSD-3-Clause
 */

#include <odp/errno.h>
#include <odp_internal.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)
		printf("%s ", str);

	ODP_PRINT("%s\n", strerror(__odp_errno));
}

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