diff options
author | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-11-04 16:42:15 +0000 |
---|---|---|
committer | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-11-04 17:28:03 +0000 |
commit | f0ca6415e7d438a0707e1f065e24751b10679e44 (patch) | |
tree | 1b2ae5a8538f13ff59867c61636382ca9b040caf /platform/linux-dpdk | |
parent | fc8047efd8045d763ce241175930443879c686ed (diff) |
linux-dpdk: errno: create localy copy of linux-generic implementation
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Diffstat (limited to 'platform/linux-dpdk')
-rw-r--r-- | platform/linux-dpdk/Makefile.am | 2 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_errno.c | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 8bc99fa1a..a624fdfc4 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -152,7 +152,7 @@ __LIB__libodp_la_SOURCES = \ ../linux-generic/odp_cpu.c \ odp_cpumask.c \ ../linux-generic/odp_crypto.c \ - ../linux-generic/odp_errno.c \ + odp_errno.c \ ../linux-generic/odp_event.c \ odp_init.c \ ../linux-generic/odp_impl.c \ diff --git a/platform/linux-dpdk/odp_errno.c b/platform/linux-dpdk/odp_errno.c new file mode 100644 index 000000000..1a76d4366 --- /dev/null +++ b/platform/linux-dpdk/odp_errno.c @@ -0,0 +1,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); +} |