|
|
Terminal Device Control functions offer a general terminal interface for controlling asynchronous communication-ports in a device-independent manner using parameters stored in the termios structure which is defined by the <termios.h> header file (see termio(7)). UNIX System V also uses termios to control the operation of network-connections.
Terminal device control functions
Function | Description |
---|---|
cfgetospeed | get output baud-rate |
cfsetospeed | set output baud-rate |
cfgetispeed | get input baud-rate |
cfsetispeed | set input baud-rate |
tcgetattr | get state of terminal |
tcsetattr | set state of terminal |
tcsendbreak | line control function |
tcdrain | line control function |
tcflush | line control function |
tcflow | line control function |
tcgetpgrp | get foreground process-group-id |
tcsetpgrp | set foreground process-group-id |
The termios structure stores the values of settable terminal I/O parameters used by functions to control terminal I/O characteristics and the operation of a terminal-device-file. The <termios.h> header file defines the termios structure to contain at least the following members (see termio(7)):
tcflag_t c_iflag; /* input modes */ tcflag_t c_oflag; /* output modes */ tcflag_t c_cflag; /* control modes */ tcflag_t c_lflag; /* local modes */ cc_t c_cc[NCCS]; /* control chars */
The <termios.h> header file defines the type tcflag_t as long, the type cc_t as char. The <termios.h> header file also defines the symbolic-constant NCCS as the size of the control-character array.