try a different approach with ioctl and write