mem: set fd to -1 for anonymous mmap
authorNeil Horman <nhorman@tuxdriver.com>
Thu, 12 Apr 2018 11:16:40 +0000 (07:16 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 12 Apr 2018 12:44:24 +0000 (14:44 +0200)
commit34fbfa585cbfa5e3e1de5b0137e91ecfdc87e4f9
tree0c18a4092bfe336953543726f386f101e9e496b4
parentb3ec974c344c0528f34e475584ad3ea0f219fa85
mem: set fd to -1 for anonymous mmap

https://dpdk.org/tracker/show_bug.cgi?id=18

Indicated that several mmap call sites in the [linux|bsd]app eal code
set fd that was not -1 in their calls while using MAP_ANONYMOUS.  While
probably not a huge deal, the man page does say the fd should be -1 for
portability, as some implementations don't ignore fd as they should for
MAP_ANONYMOUS.

Suggested-by: Solal Pirelli <solal.pirelli@gmail.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/bsdapp/eal/eal_memory.c
lib/librte_eal/linuxapp/eal/eal_memory.c