eal: fix build with musl
authorThomas Monjalon <thomas@monjalon.net>
Wed, 24 Feb 2021 23:21:58 +0000 (00:21 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 23 Mar 2021 07:41:05 +0000 (08:41 +0100)
commite0473c6d5b18560dd11fd4d7ebc81dea6774f33e
tree88aa8c97d3c60a8666aa280a3213e262aa46b9c2
parente0ae50c6876e899540f6116f8b4f5e5e3dec445f
eal: fix build with musl

In musl libc, cpu_set_t is defined only if _GNU_SOURCE is defined.
In case _GNU_SOURCE is undefined, as in eal_common_errno.c,
it was not possible to include rte_os.h which uses cpu_set_t.

This limitation is removed: if CPU_SETSIZE is not defined,
cpu_set_t related definitions and functions are skipped.
Note: such definitions are unneeded in eal_common_errno.c.

Applications which do not define _GNU_SOURCE may miss cpu_set_t related
features on musl. Such case is detected by RTE_HAS_CPUSET being undefined,
so functions which depend on rte_cpuset_t will be unavailable.

A missing include of fcntl.h is also added.

Bugzilla ID: 35
Fixes: 11b57c698005 ("eal: fix error string function")
Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file operations")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
doc/api/doxy-api.conf.in
lib/librte_eal/freebsd/include/rte_os.h
lib/librte_eal/include/rte_lcore.h
lib/librte_eal/include/rte_thread.h
lib/librte_eal/linux/include/rte_os.h
lib/librte_eal/unix/eal_file.c
lib/librte_eal/windows/include/sched.h
lib/librte_telemetry/rte_telemetry.h