On the BSDs, mincore is defined to return char values rather than
unsigned char values, so test for that and adjust our invocation.
Also check for MINCORE_INCORE, which is used on some platforms to test
the returned status bytes. When it's found, define
helpers.MINCORE_INCORE appropriately.
Rework the mincore-related code, moving much of the fmincore C code to
Python to avoid dealing with platform-related strerror_r differences,
and replace the _helpers fmincore with a more primitive mincore.
To accommodate the more complicated ./configure testing, require bash,
and use printf -v to (safely) set ac_defined_$name during all calls to
AC_DEFINE so that we can use the discovered values to guard tests during
configuration.
Thanks to Thomas Klausner for reporting the problem.
Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>