Proper usage of tcsetattr