Previous | Table of Contents | Next

Page 875

termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, tcgetpgrp, tcsetpgrp
ISTRIP Strip off the eighth bit.
INLCR Translate NL to CR on input.
IGNCR Ignore carriage return on input.
ICRNL Translate carriage return to newline on input (unless IGNCR is set).
IUCLC Map uppercase characters to lowercase on input.
IXON Enable XON/XOFF flow control on output.
IXANY Enable any character to restart output.
IXOFF Enable XON/XOFF flow control on input IMAXBEL ring bell when input queue is full.

The following are the c_oflag flag constants:

OPOST Enable implementation-defined output processing.
OLCUC Map lowercase characters to uppercase on output.
ONLCR Map NL to CR-NL on output.
OCRNL Map CR to NL on output.
ONOCR Don't output CR at column 0.
ONLRET Don't output CR.
OFILL Send fill characters for a delay rather than use a timed delay.
OFDEL Fill character is ASCII DEL. If unset, fill character is ASCII NUL.
NLDLY Newline delay mask. Values are NL0 and NL1.
CRDLY Carriage-return delay mask. Values are CR0, CR1, CR2, and CR3.
TABDLY Horizontal-tab delay mask. Values are TAB0, TAB1, TAB2, TAB3, and XTABS. A value of XTABS expands tabs to spaces (with tab stops every eight columns).
BSDLY
Backspace delay mask. Values are BS0 and BS1.
VTDLY Vertical-tab delay mask. Values are VT0 and VT1.
FFDLY Form-feed delay mask. Values are FF0 and FF1.

The following are the c_cflag flag constants:
CSIZE Character size mask. Values are CS5, CS6, CS7,and CS8.
CSTOPB Set two stop bits rather than one.
CREAD Enable receiver.
PARENB Enable parity generation on output and parity checking for input.
PARODD Parity for input and output is odd.
HUPCL Lower modem control lines after last process closes the device (hangs up).
CLOCAL Ignore modem control lines.
CIBAUD Mask for input speeds (not used).
CRTSCTS Flow control.

The following are the c_lflag flag constants:
ISIG When any of the characters INTR, QUIT, SUSP, or DSUSP are received, generate the corresponding signal.
ICANON Enables canonical mode. This allows the special characters EOF, EOL, EOL2, ERASE, KILL, REPRINT, STATUS, and WERASE, and also buffers by lines.
XCASE If ICANON is also set, terminal is uppercase only. Input is converted to lowercase, except for characters preceded by \. On output, uppercase characters are preceded by \, and lowercase characters are converted to uppercase.
ECHO Echo input characters.

Page 876

ECHOE If ICANON is also set, the ERASE character erases the preceding input character, and WERASE erases the preceding word.
ECHOK If ICANON is also set, the KILL character erases the current line.
ECHONL If ICANON is also set, echo the NL character even If ECHO is not set.
ECHOCTL If ECHO is also set, ASCII control signals other than TAB, NL, START, and STOP are echoed as Ctrl+X, where X is the character with ASCII code 0x10 greater than the control signal. For example, character 0x28 (BS) is echoed as Ctrl+H.
ECHOPRT If ICANON and IECHO are also set, characters are printed as they are being erased.
ECHOKE If ICANON is also set, KILL is echoed by erasing each character on the line, as specified by ECHOE and ECHOPRT.
FLUSHO Output is being flushed. This flag is toggled by typing the DISCARD character.
NOFLSH Disables flushing of the input and output queues when generating the SIGINT and SIGQUIT signals, and flushing of the input queue when generating the SIGSUSP signal.
TOSTOP Sends the SIGTTOU signal to the process group of a background process that tries to write to its controlling terminal.
PENDIN All characters in the input queue are reprinted when the next character is read. (bash handles typeahead this way.)
IEXTEN Enable implementation-defined input processing.

tcgetattr() gets the parameters associated with the object referred by fd and stores them in the termios structure referenced by termios_p. This function may be invoked from a background process; however, the terminal attributes may be subsequently changed by a foreground process.

tcsetattr() sets the parameters associated with the terminal (unless support is required from the underlying hardware that is not available) from the termios structure referred to by termios_p. optional_actions specifies when the changes take effect:

TCSANOW The change occurs immediately.
TCSADRAIN The change occurs after all output written to fd has been transmitted. This function should be used when changing parameters that affect output.
TCSAFLUSH The change occurs after all output written to the object referred to by fd has been transmitted, and all input that has been received but not read will be discarded before the change is made.

tcsendbreak() transmits a continuous stream of zero-valued bits for a specific duration, if the terminal is using asynchronous serial data transmission. If duration is 0, it transmits zero-valued bits for at least 0.25 seconds, and not more than 0.5 seconds. If duration is not 0, it sends zero-valued bits for duration*N seconds, where N is at least 0.25, and not more

If the terminal is not using asynchronous serial data transmission, tcsendbreak() returns without taking any action.

tcdrain() waits until all output written to the object referred to by fd has been transmitted.

tcflush() discards data written to the object referred to by fd but not transmitted, or data received but not read, depending on the value of queue_selector:

TCIFLUSH Flushes data received but not read.
TCOFLUSH
Flushes data written but not transmitted.
TCIOFLUSH Flushes both data received but not read and data written but not transmitted.

tcflow() suspends transmission or reception of data on the object referred to by fd, depending on the value of action:
TCOOFF Suspends output.
TCOON Restarts suspended output.
TCIOFF Transmits a STOP character, which stops the terminal device from transmitting data to the system.
TCION Transmits a START character, which starts the terminal device transmitting data to the system.

Previous | Table of Contents | Next

1