Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tcsendbreak(3V) — NEWS-os 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

termio(4V)

TCSENDBREAK(3V)  —  NEWS-OS Programmer’s Manual

NAME

tcsendbreak, tcdrain, tcflush, tcflow − line control

SYNOPSIS

#include <termios.h>

int tcsendbreak(fd, duration)
int fd;
int duration;

int tcdrain(fd)
int fd;

int tcflush(fd, queue_selector)
int fd;
int queue_selector;

int tcflow(fd, action)
int fd;
int action;

DESCRIPTION

These functions describe a general terminal interface that is provided to control asynchronous communications ports.  A more detailed overview of the terminal interface can be found in termio(4V). That section also describes an ioctl interface that can be used to access the same functionality.  However, the function interface described here is the preferred user interface. 

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

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:

• If queue_selector is TCIFLUSH, it flushes data received but not read. 

• If queue_selector is TCOFLUSH, it flushes data written but not transmitted. 

• If queue_selector is TCIOFLUSH, it 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 actions:

• If action is TCOOFF, it suspends output. 

• If action is TCOON, it restarts suspended output. 

• If action is TCIOFF, the system transmits a STOP character, which stops the terminal device from transmitting data to the system.  (See termio(4V).)

• If action is TCION, the system transmits a START character, which starts the terminal device transmitting data to the system.  (See termio(4V).)

The default on open of a terminal file is that neither its input nor its output is suspended. 

The symbolic constants for the values of queue_selector and action are defined in <termios.h>. 

The default on open of a terminal file is that neither its input nor its output is suspended. 

RETURN VALUES

Upon successful completion, a value of zero is returned.  Otherwise, a value of −1 and set errno to the corresponding value:

ERRORS

EBADF The fd argument is not a valid file descriptor. 

ENOTTY The file associated with fd is not a terminal. 

EINTR A signal interrupted tcdrain. 

EINVAL The device does not support the function. 

EINVAL The queue_selector or the action argument is not a proper value. 

SEE ALSO

termio(4V)

NEWS-OSRelease 4.1C

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026