Re-enable and fix unit test for nofork mappings
commit065e7da8e6fdbd9331de8c13344275a8e0fbf32d
authorNick Mathewson <nickm@torproject.org>
Mon, 25 Feb 2019 13:55:25 +0000 (25 08:55 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 25 Feb 2019 13:55:25 +0000 (25 08:55 -0500)
tree063d36265dd691d1e49232358e4267c417d4ed96
parent69238ca2da923c8a50d5c1007f3e702eea163b50
Re-enable and fix unit test for nofork mappings

This test was previously written to use the contents of the system
headers to decide whether INHERIT_NONE or INHERIT_ZERO was going to
work.  But that won't work across different environments, such as
(for example) when the kernel doesn't match the headers.  Instead,
we add a testing-only feature to the code to track which of these
options actually worked, and verify that it behaved as we expected.

Closes ticket 29541; bugfix not on any released version of Tor.
src/lib/malloc/map_anon.c
src/lib/malloc/map_anon.h
src/test/test_util.c