Remove duplicate function.
Ignore SIGHUP and SIGPIPE signals.
Split buffer into separate read and write buffers.
Improve support for shared libraries on Solaris.