Add safe macros to LTP.

The purpose of this is to:
1. Reduce lazy programming (a lot of the older testcases weren't written in a
   very complete manner).
2. Resolve warnings reported by gcc with glibc functions that have the
   warning_unused_result attribute attached to them (pipe, warn, etc).
3. Consolidate error catching in a consistent manner.

The end goal is to ensure that if failures occur in critical functions, then
the test will react consistent to the way a robust test would, not in a
cross-your-fingers and we hope that I/O operations work type of way.

The functions are defined non-static because otherwise it would fail to compile
with -Wunused.

Also add a simple tool to exercise all of the safe macros, sans SAFE_CREAT.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
3 files changed