fixes so the posix version can be built on cygwin