tcflow()

Perform a flow-control operation on a data stream

Synopsis:

#include <termios.h>

int tcflow( int fildes, 
            int action );

Arguments:

fildes
A file descriptor that's associated with the data stream that you want to perform the operation on.
action
The action you want to perform; see below.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The tcflow() function performs a flow-control operation on the data stream associated with fildes, depending on the values in action.

At least the following actions are defined in <termios.h>:

TCOOFF
Use software flow control to suspend output on the device associated with fildes.
TCOOFFHW
Use hardware flow control to suspend output on the device associated with fildes.
TCOON
Use software flow control to resume output on the device associated with fildes.
TCOONHW
Use hardware flow control to resume output on the device associated with fildes.
TCIOFF
Cause input to be flow-controlled by sending a STOP character immediately across the communication line associated with fildes, (that is, software flow control).
TCIOFFHW
Cause input to be flow-controlled by using hardware control.
TCION
Resume input by sending a START character immediately across the communication line associated with fildes (that is, software flow control).
TCIONHW
Cause input to be resumed by using hardware flow control.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EBADF
Invalid fildes argument.
EINVAL
Invalid action argument.
ENOSYS
The resource manager associated with fildes doesn't support this call.
ENOTTY
The argument fildes doesn't refer to a terminal device.

Examples:

#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main( void )
  {
    int fd;

    fd = open( "/dev/ser1", O_RDWR );

    /* Resume output on flow-controlled device */
    tcflow( fd, TCOON );

    close( fd );
    return EXIT_SUCCESS;
  }

Classification:

POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes