added ioctl functionality