mem: add external API to retrieve page fd
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 4 Sep 2018 15:15:48 +0000 (16:15 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Sep 2018 12:48:04 +0000 (14:48 +0200)
commit41dbdb68723b2d0b13ea47e9b8622c07c0f007c7
tree8336cf1adbb3c688175da3f35f5c20623781c8d0
parent1009ba1704f9cffd47d46fb8eda8671ef30e966d
mem: add external API to retrieve page fd

Now that we can retrieve page fd's internally, we can expose it
as an external API. This will add two flavors of API - thread-safe
and non-thread-safe. Fix up internal API's to return values we need
without modifying rte_errno internally if called from within EAL.

We do not want calling code to accidentally close an internal fd, so
we make a duplicate of it before we return it to the user. Caller is
therefore responsible for closing this fd.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_eal/bsdapp/eal/eal_memalloc.c
lib/librte_eal/common/eal_common_memory.c
lib/librte_eal/common/eal_memalloc.h
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/linuxapp/eal/eal_memalloc.c
lib/librte_eal/rte_eal_version.map