Remove xioctl and replace with ioctl function