Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tcflow(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

tcattr(S)

ttiocom(K)


 tcflow(S)                      6 January 1993                      tcflow(S)


 Name

    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

    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(K) for more information on the TCSBRK value that tcsend-
    break 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
    queueselector:

    +  If queueselector is TCIFLUSH, it flushes data received but not read.

    +  If queueselector is TCOFLUSH, it flushes data written but not
       transmitted.

    +  If queueselector is TCIOFLUSH, it performs both actions.

    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:

    +  If action is TCOOFF, output is suspended.

    +  If action is TCOON, output is restarted.

    +  If action is TCIOFF, a STOP character is transmitted, which is
       intended to cause the terminal to stop transmitting data to the sys-
       tem.

    +  If action is TCION, a START character is transmitted, which is
       intended to cause the terminal to start transmitting data to the sys-
       tem.

    The symbolic constants for the values of queueselector 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 POSIXJOBCONTROL 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. Other-
    wise, 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 queueselector 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(K)

 Standards conformance

    tcdrain, tcflow, tcflush and tcsendbreak are conformant with:
    AT&T SVID Issue 2;
    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).


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