Use stdio.h instead of cstdio for fdopen. Wrap all used POSIX functions for testing.