OpenBSD manual page server

Manual Page Search Parameters

TCSENDBREAK(3) Library Functions Manual TCSENDBREAK(3)

tcdrain, tcflow, tcflush, tcsendbreakline control functions

#include <termios.h>

int
tcdrain(int fd);

int
tcflow(int fd, int action);

int
tcflush(int fd, int action);

int
tcsendbreak(int fd, int len);

The () function waits until all output written to the terminal referenced by fd has been transmitted to the terminal.

The () function suspends transmission of data to or the reception of data from the terminal referenced by fd depending on the value of action. The value of action must be one of the following:

Suspend output.
Restart suspended output.
Transmit a STOP character, which is intended to cause the terminal to stop transmitting data to the system. (See the description of IXOFF in the ‘Input Modes’ section of termios(4)).
Transmit a START character, which is intended to cause the terminal to start transmitting data to the system. (See the description of IXOFF in theInput Modes’ section of termios(4)).

The () function discards any data written to the terminal referenced by fd which has not been transmitted to the terminal, or any data received from the terminal but not yet read, depending on the value of action. The value of action must be one of the following:

Flush data received but not read.
Flush data written but not transmitted.
Flush both data received but not read and data written but not transmitted.

The () function transmits a continuous stream of zero-valued bits for four-tenths of a second to the terminal referenced by fd. The len parameter is ignored in this implementation.

Upon successful completion, all of these functions return a value of zero.

If any error occurs, a value of -1 is returned and the global variable errno is set to indicate the error, as follows:

[]
The fd argument is not a valid file descriptor.
[]
The action argument is not a proper value.
[]
The file associated with fd is not a terminal.
[]
A signal interrupted the tcdrain() function.

tcsetattr(3), termios(4)

The tcdrain(), tcflow(), tcflush(), and tcsendbreak() functions are compliant with the IEEE Std 1003.1-1988 (“POSIX.1”) specification.

January 12, 2023 OpenBSD-current