diff options
Diffstat (limited to 'platform/linux-dpdk/odp_errno.c')
-rw-r--r-- | platform/linux-dpdk/odp_errno.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/platform/linux-dpdk/odp_errno.c b/platform/linux-dpdk/odp_errno.c new file mode 100644 index 000000000..5fb698f26 --- /dev/null +++ b/platform/linux-dpdk/odp_errno.c @@ -0,0 +1,35 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp/api/errno.h> +#include <odp_internal.h> +#include <string.h> +#include <stdio.h> +#include <odp_debug_internal.h> +#include <rte_errno.h> + +int odp_errno(void) +{ + return rte_errno; +} + +void odp_errno_zero(void) +{ + rte_errno = 0; +} + +void odp_errno_print(const char *str) +{ + if (str != NULL) + printf("%s ", str); + + ODP_PRINT("%s\n", strerror(rte_errno)); +} + +const char *odp_errno_str(int errnum) +{ + return strerror(errnum); +} |