Next: Changing Terminal Modes
Up: Terminal Control the Hard
Previous: Controlling Terminals
- Of the functions that manipulate termios structures, tcgetattr() and tcsetattr() are the most frequently used.
- As their names suggest, tcgetattr() queries a terminal's state and tcsetattr() changes it.
Both accept a file descriptor fd that corresponds to the process's controlling terminal and a pointer tp to a termios struct.
- The http://siber.cankaya.edu.tr/SystemsProgramming/cfiles/noecho.c program in Fig. 2 illustrates using termios to turn off character echo when entering a password.
Figure 2:
Using termios to turn off character echo.
|
Cem Ozdogan
2007-05-14