Similar to what's been done in the ports, but this time in generic code.
Add missing #includes to pick up prototypes. Add prototypes for various
internal functions where needed. Fix signatures of various functions to match
what's provided by the headers (read, sbrk, write, unlink).
Nearly done with this effort ;-)
Pushed to the trunk,