Fixed a typo for dup2() if not provided by the system
Added some headers with compatibility code for Darwin
Updated some copyright lines
Reflected some type definitions for Darwin