[Previous]
[Contents]
[Next]

tcflow()

perform a flow-control operation on a data stream

Synopsis:

#include <termios.h>
int tcflow( int fildes, int action );

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
tcflow() will cause output to be suspended on the device associated with fildes, by using software flow control.
TCOOFFHW
tcflow() will cause output to be suspended on the device associated with fildes, by using hardware flow control.
TCOON
tcflow() will cause output to be resumed on the device associated with fildes, by using software flow control.
TCOONHW
tcflow() will cause output to be resumed on the device associated with fildes, by using hardware flow control.
TCIOFF
tcflow() will 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
tcflow() will cause input to be flow controlled by using hardware flow control.
TCION
tcflow() will cause input to be resumed by sending a START character immediately across the communication line associated with fildes (that is, software flow control).
TCIONHW
tcflow() will cause input to be resumed by using hardware flow control.

Returns:

0
Success
-1
An error occurred. errno is set to indicate the error.

Errors:

EBADF
The argument fildes is invalid.
EINVAL
The argument action is invalid.
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>

void main()
  {
    int fd;

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

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

    close( fd );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

errno, tcdrain(), tcflush(), tcsendbreak()


[Previous]
[Contents]
[Next]