numam-dpdk/lib/librte_eal/common
Jerin Jacob 11b57c6980 eal: fix error string function
errno_autotest testcase were failed since
commit 5d7b673d5f ("mk: build with _GNU_SOURCE defined by default")
RTE>>errno_autotest
rte_strerror: 'Unknown error 11',
strerror: 'Resource temporarily unavailable'
Test Failed

There are two different version of strerror_t() based on
_GNU_SOURCE definition.

/* XSI-compliant */
int strerror_r(int errnum, char *buf, size_t buflen);

/* GNU-specific */
char *strerror_r(int errnum, char *buf, size_t buflen);

Since the GNU-specific version returns char* the exiting "if"
condition around the strerror_r fails.

Switching back to XSI-compliant version to allow

a) Portable strerror_r() usage as musl c library uses
non GNU speficic version
https://git.musl-libc.org/cgit/musl/tree/src/string/strerror_r.c

b) Based on strerror_r(3) man page, it is possible that GNU-specific
version need not use char *buf to fill error message instead it
can use the immutable static string from the library and return it.

note from strerror_r(3) man page:

The GNU-specific strerror_r() returns a pointer to a string containing
the error message.  This may be either a pointer to a string that the
function stores in buf, or a pointer to some (immutable)
static string (in which case buf is unused).

Fixes: 5d7b673d5f ("mk: build with _GNU_SOURCE defined by default")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2018-11-04 22:25:20 +01:00
..
arch build: add ppc64 meson build 2018-09-17 12:21:17 +02:00
include version: 18.11-rc1 2018-10-29 04:08:26 +01:00
eal_common_bus.c add missing static keyword to globals 2018-10-29 02:01:08 +01:00
eal_common_class.c add missing static keyword to globals 2018-10-29 02:01:08 +01:00
eal_common_cpuflags.c eal: fix build on FreeBSD 2018-04-27 11:13:59 +02:00
eal_common_dev.c eal: remove deprecated attach/detach functions 2018-10-26 22:14:05 +02:00
eal_common_devargs.c add missing static keyword to globals 2018-10-29 02:01:08 +01:00
eal_common_errno.c eal: fix error string function 2018-11-04 22:25:20 +01:00
eal_common_fbarray.c fbarray: improve musl compatibility 2018-10-22 11:28:46 +02:00
eal_common_hexdump.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_hypervisor.c align SPDX Mellanox copyrights 2018-04-11 01:47:47 +02:00
eal_common_launch.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_lcore.c eal: provide API for querying valid socket ids 2018-04-05 00:27:13 +02:00
eal_common_log.c remove useless constructor headers 2018-07-12 00:00:35 +02:00
eal_common_memalloc.c mem: add missing newline in callback log 2018-05-30 21:16:43 +02:00
eal_common_memory.c mem: use address hint for mapping hugepages 2018-10-28 22:06:05 +01:00
eal_common_memzone.c mem: do not check for invalid socket ID 2018-10-11 10:37:45 +02:00
eal_common_options.c eal: add --iova-mode option 2018-10-28 23:41:26 +01:00
eal_common_proc.c ipc: fix undefined behavior in no-shconf mode 2018-10-24 21:49:57 +02:00
eal_common_string_fns.c eal: add strscpy function 2018-09-19 11:38:19 +02:00
eal_common_tailqs.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
eal_common_thread.c eal: fix return codes on control thread failure 2018-07-13 00:27:15 +02:00
eal_common_timer.c eal: add nanosleep based delay function 2018-10-26 22:14:06 +02:00
eal_common_uuid.c eal: add uuid API 2018-07-13 23:42:08 +02:00
eal_filesystem.h eal: export function to get runtime directory 2018-10-27 12:10:24 +02:00
eal_hugepages.h mem: share hugepage info primary and secondary 2018-04-11 21:45:55 +02:00
eal_internal_cfg.h eal: add --iova-mode option 2018-10-28 23:41:26 +01:00
eal_memalloc.h mem: allow querying offset into segment fd 2018-09-19 15:01:58 +02:00
eal_options.h eal: add --iova-mode option 2018-10-28 23:41:26 +01:00
eal_private.h eal: add option register infrastructure 2018-10-27 12:10:10 +02:00
eal_thread.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
hotplug_mp.c eal: fix memory leak on multi-process hotplug rollback 2018-11-02 00:05:49 +01:00
hotplug_mp.h eal: enable hotplug on multi-process 2018-10-17 10:16:18 +02:00
Makefile eal: add option register infrastructure 2018-10-27 12:10:10 +02:00
malloc_elem.c mem: allow memseg lists to be marked as external 2018-10-11 10:24:29 +02:00
malloc_elem.h malloc: add finding biggest free IOVA-contiguous element 2018-07-13 11:23:07 +02:00
malloc_heap.c mem: add function for checking memseg IOVA 2018-10-28 22:04:34 +01:00
malloc_heap.h malloc: allow removing memory from named heaps 2018-10-11 11:56:55 +02:00
malloc_mp.c malloc: fix potential null pointer dereference 2018-09-16 11:23:12 +02:00
malloc_mp.h malloc: support multiprocess memory hotplug 2018-04-11 21:45:55 +02:00
meson.build eal: add option register infrastructure 2018-10-27 12:10:10 +02:00
rte_keepalive.c keepalive: fix state alignment 2018-01-25 23:25:57 +01:00
rte_malloc.c malloc: fix external heap allocation in no-huge mode 2018-10-26 22:37:59 +02:00
rte_option.c eal: add option register infrastructure 2018-10-27 12:10:10 +02:00
rte_reciprocal.c eal: add u64-bit variant for reciprocal divide 2018-01-27 22:34:47 +01:00
rte_service.c service: add mechanism for quiescing 2018-07-06 06:54:49 +02:00