[incfs] libhardening: implementation of SIGBUS handling

This library adds a set of functions and low level macros
for IncFS error handling:

hardening::access() lets one to wrap memory-mapped file
reads into a handler that would turn your code's return
to an optional<>. In case of read error SIGBUS gets
converted to an empty optional<>. If the code doesn't
return anything access() returns a simple bool.

HANDLE_SIGBUS() is a low level macro that doesn't turn
the return value into an optional<>, and doesn't add a
lambda overhead, but, on the other hand, has a drawback:
one has to write their own error handling code, and that
code has to be signal-safe and not allocate any new resources
or access IncFS again - it isn't be protected anymore.

Bug: 160634944
Test: incfs tests and libhardening benchmarks
Change-Id: I72441234ffe0b836fbc722a43594fc8fe59b2414
8 files changed
tree: 3eeb351df04c09a0fdaf8c9d61d5cc859617e432
  1. incfs/
  2. libdataloader/
  3. libhardening/
  4. sysprop/
  5. .clang-format
  6. PREUPLOAD.cfg