151202Smarc.\" Copyright (c) 1991 The Regents of the University of California. 251202Smarc.\" All rights reserved. 351202Smarc.\" 451202Smarc.\" %sccs.include.redist.roff% 551202Smarc.\" 6*52294Smarc.\" @(#)tcsendbreak.3 5.1 (Berkeley) 02/03/92 751202Smarc.\" 8*52294Smarc.Dd Jun 11, 1991 9*52294Smarc.Dt LINE 3 10*52294Smarc.Os 11*52294Smarc.Sh NAME 12*52294Smarc.Nm tcsendbreak, 13*52294Smarc.Nm tcdrain, 14*52294Smarc.Nm tcflush, 15*52294Smarc.Nm tcflow 1651202Smarc.LP 1751202Smarc.B "Synopsis" 18*52294Smarc.Ft int 19*52294Smarc.Fn tcdrain "int fd" 20*52294Smarc.Ft int 21*52294Smarc.Fn tcflow "int fd" "int action" 22*52294Smarc.Ft int 23*52294Smarc.Fn tcflush "int fd" "int which" 24*52294Smarc.Ft int 25*52294Smarc.Fn tcsendbreak "int fd" "int len" 2651202Smarc.nf 2751202Smarc#include <termios.h> 2851202Smarc 2951202Smarcint tcsendbreak(int fildes, int duration); 3051202Smarcint tcdrain(int fildes); 3151202Smarc 3251202Smarcint tcflush(int fildes, int queue_selector); 3351202Smarcint tcflow(int fildes, int action); 3451202Smarc.fi 3551202Smarc.LP 3651202Smarc.B "Description" 3751202Smarc.LP 3851202SmarcIf the terminal is using asynchronous serial data transmission, the 3951202Smarctcsendbreak() function shall cause transmission of a continuous stream of 4051202Smarczero-valued bits for a specific duration. If duration is zero, it shall 4151202Smarccause transmission of zero-valued bits for at least 0.25 seconds, and not 4251202Smarcmore that 0.5 seconds. 4351202Smarc.PP 4451202SmarcThe tcdrain() function shall wait until all output written to the object 4551202Smarcreferred to by fildes has been transmitted. 4651202Smarc.PP 4751202SmarcUpon successful completion, the tcflush() function shall have discarded 4851202Smarcany data written to the object referred to by fildes but not transmitted, 4951202Smarcor data received but not read, depending on the value of queue_selector: 5051202Smarc.nf 5151202Smarc (1) If queue_selector is TCIFLUSH, it shall flush data received but 5251202Smarc not read. 5351202Smarc 5451202Smarc (2) If queue_selector is TCOFLUSH, it shall flush data written but 5551202Smarc not transmitted. 5651202Smarc 5751202Smarc (3) If queue_selector is TCIOFLUSH, it shall flush both data 5851202Smarc received but not read, and data written but not transmitted. 5951202Smarc.fi 6051202Smarc.PP 6151202SmarcThe tcflow() function shall suspend transmission or reception of data on 6251202Smarcthe object referred to by fildes, depending on the value of action: 6351202Smarc.nf 6451202Smarc (1) If action is TCOOFF, it shall suspend output. 6551202Smarc 6651202Smarc (2) If action is TCOON, it shall restart suspended output. 6751202Smarc 6851202Smarc (3) If action is TCIOFF, the system shall transmit a STOP character, 6951202Smarc which is intended to cause the terminal device to stop 7051202Smarc transmitting data to the system. (See the description of IXOFF 7151202Smarc in "Input Modes".) 7251202Smarc 7351202Smarc (4) If action is TCION, the system shall transmit a START character, 7451202Smarc which is intended to cause the terminal device to start 7551202Smarc transmitting data to the system. (See the description of IXOFF 7651202Smarc in "Input Modes".) 7751202Smarc.fi 7851202Smarc.LP 7951202Smarc.B "Returns" 8051202Smarc.LP 8151202SmarcUpon successful completion, a value of zero is returned. Otherwise, a 8251202Smarcvalue of -1 is returned and errno is set to indicate the error. 8351202Smarc.LP 8451202Smarc.B "Errors" 8551202Smarc.LP 8651202SmarcIf any of the following conditions occur, the tcsendbreak() function 8751202Smarcshall return -1 and set errno to the corresponding value: 8851202Smarc.nf 8951202Smarc [EBADF] The fildes argument is not a valid file descriptor. 9051202Smarc 9151202Smarc [ENOTTY] The file associated with fildes is not a terminal. 9251202Smarc.fi 9351202Smarc.PP 9451202SmarcIf any of the following conditions occur, the tcdrain() function shall 9551202Smarcreturn -1 and set errno to the corresponding value: 9651202Smarc.nf 9751202Smarc [EBADF] The fildes argument is not a valid file descriptor. 9851202Smarc 9951202Smarc [EINTR] A signal interrupted the tcdrain() function. 10051202Smarc 10151202Smarc [ENOTTY] The file associated with fildes is not a terminal. 10251202Smarc.fi 10351202Smarc.PP 10451202SmarcIf any of the following conditions occur, the tcflush() function shall 10551202Smarcreturn -1 and set errno to the corresponding value: 10651202Smarc.nf 10751202Smarc [EBADF] The fildes argument is not a valid file descriptor. 10851202Smarc 10951202Smarc [EINVAL] The queue_selector argument is not a proper value. 11051202Smarc 11151202Smarc [ENOTTY] The file associated with fildes is not a terminal. 11251202Smarc.fi 11351202Smarc.PP 11451202SmarcIf any of the following conditions occur, the tcflow() function shall 11551202Smarcreturn -1 and set errno to the corresponding value: 11651202Smarc.nf 11751202Smarc [EBADF] The fildes argument is not a valid file descriptor. 11851202Smarc 11951202Smarc [EINVAL] The action argument is not a proper value. 12051202Smarc 12151202Smarc [ENOTTY] The file associated with fildes is not a terminal. 12251202Smarc.fi 123