wip: deal wih overflow in ioctl