[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

tcsendbreak Subroutine

Purpose

Sends a break on an asynchronous serial data line.

Library

Standard C Library (libc.a)

Syntax

#include <termios.h>


int tcsendbreak( FileDescriptor, Duration)
int FileDescriptor;
int Duration;

Description

If the terminal is using asynchronous serial data transmission, the tcsendbreak subroutine causes transmission of a continuous stream of zero-valued bits for a specific duration.

If the terminal is not using asynchronous serial data transmission, the tcsendbreak subroutine returns without taking any action.

Pseudo-terminals and LFT do not generate a break condition. They return without taking any action.

Parameters

FileDescriptor Specifies an open file descriptor.
Duration Specifies the number of milliseconds that zero-valued bits are transmitted. If the value of the Duration parameter is 0, it causes transmission of zero-valued bits for at least 250 milliseconds and not longer than 500 milliseconds. If Duration is not 0, it sends zero-valued bits for Duration milliseconds.

Return Values

Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.

Error Codes

The tcsendbreak subroutine is unsuccessful if one or both of the following are true:

EBADF The FileDescriptor parameter does not specify a valid open file descriptor.
EIO The process group of the writing process is orphaned, and the writing process does not ignore or block the SIGTTOU signal.
ENOTTY The file associated with the FileDescriptor parameter is not a terminal.

Examples

  1. To send a break condition for 500 milliseconds, enter:

    rc = tcsendbreak(stdout,500);
  2. To send a break condition for 25 milliseconds, enter:

    rc = tcsendbreak(1,25);

    This could also be performed using the default Duration by entering:

    rc = tcsendbreak(1, 0);

Related Information

The tcdrain (tcdrain Subroutine) subroutine, tcflow (tcflow Subroutine) subroutine, tcflush (tcflush Subroutine) subroutine.

The Input and Output Handling Programmer's Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]