DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

tcflow(S)


tcdrain, tcflow, tcflush, tcsendbreak -- line control functions

Syntax

cc . . . -lc

#include <termios.h>

int tcdrain (fildes) int fildes;

int tcflow (fildes, action) int fildes, action;

int tcflush (fildes, queue_selector) int fildes, queue_selector;

int tcsendbreak (fildes, duration) int fildes, duration;

Description

tcdrain- wait until all output has been transmitted

tcflow- suspend transmission or reception of data

tcflush- discard all data not written or read

tcsendbreak- transmit zero-valued bits for specified duration

If the terminal is using asynchronous serial data transmission, the tcsendbreak function causes transmission of a continuous stream of zero-valued bits for a specific duration. If duration is zero, tcsendbreak transmits zero-valued bits for at least .25 seconds and not more than .5 seconds. If duration is not zero, tcsendbreak sends zero-valued bits for an amount of time dependent on the baud rate and the line discipline. Refer to ttiocom(D3oddi) for more information on the TCSBRK value that tcsendbreak calls.

If the terminal is not using asynchronous serial data transmission, it is implementation defined whether the tcsendbreak function sends data to generate a break condition (as defined by the implementation) or returns without taking any action.

The tcdrain function waits until all output written to fildes has been transmitted.

The tcflush function discards all data written to fildes but not transmitted, or data received but not read, depending on the value of queue_selector:

The tcflow function suspends transmission or reception of data on the object referred to by fildes, depending on the value of action. Possible values for action include:

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.

Note

If POSIX_JOB_CONTROL is defined, attempts to use tcdrain, tcflow, tcflush, or tcsendbreak from a process that is a member of a background process group on a fildes associated with its controlling terminal, cause the process group to be sent a SIGTTOU signal. If the calling process is blocking or ignoring SIGTTOU signals, the process is allowed to perform the operation, and no signal is sent.

Return value

Upon successful completion, these routines return a value of zero. Otherwise, a value of of -1 is returned and errno is set to indicate the error. Possible error conditions include:

tcdrain:


[EBADF]
The fildes argument is not a valid file descriptor.

[EINTR]
A signal interrupted the function.

[ENOTTY]
The file associated with fildes is not a terminal.

tcflow:


[EBADF]
The fildes argument is not a valid file descriptor.

[EINVAL]
The action argument is not a proper value.

[ENOTTY]
The file associated with fildes is not a terminal.

tcflush:


[EBADF]
The fildes argument is not a valid file descriptor.

[EINVAL]
The queue_selector argument is not a proper value.

[ENOTTY]
The file associated with fildes is not a terminal.

tcsendbreak:


[EBADF]
The fildes argument is not a valid file descriptor.

[ENOTTY]
The file associated with fildes is not a terminal.

See also

tcattr(S), ttiocom(D3oddi)

Driver development documentation and tools for SCO OpenServer Release 5.0.5 and later are available at the UnixWare 7 and OpenServer Hardware and Driver Development Web Page (http://www.sco.com).

Standards conformance

tcdrain, tcflow, tcflush and tcsendbreak are conformant with:

X/Open Portability Guide, Issue 3, 1989 ;
and IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1) .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003