implemented copyReg() with mmap(2) instead of read(2)+write(2) sequences