changed to use mmap to work on cygwin