Replaced mmap() calls by ioctl()