Do the following to become more familiar with terminal control.
Read the man page on struct termios .
Execute stty -a and try to understand the different fields.
Compare the facilities provided by the specific terminal calls to those provided by use of ioctl . Read the struct termios information in Section 7 of the man pages for additional information.
Read the man page for stty and write your own program modeled after it.