Change Linux specific /proc/self/fd to more portable /dev/fd version.
Added warn_unused result to function declarations.