convert tcsetattr to ioctl