[Previous]
[Contents]
[Next]

tcsendbreak()

assert a break condition over a communications line

Synopsis:

#include <termios.h>
int tcsendbreak( int fildes, int duration );

Description:

The tcsendbreak() function asserts a break condition over the communication line associated with the opened file descriptor indicated by fildes.

The break condition will be approximately 300 milliseconds if duration is zero, otherwise the break condition will last for at least duration milliseconds. The system rounds the effective value of duration up to the next highest supported interval, which is typically a multiple of 100 milliseconds.

Returns:

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

Errors:

EBADF
The argument fildes 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 );

    /*
     * Send a 500 millisecond break
     */
    tcsendbreak( fd, 500 );

    close( fd );
  }

Classification:

POSIX 1003.1

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

errno, tcdrain(), tcdropline(), tcflow(), tcflush()


[Previous]
[Contents]
[Next]