mmap, host function