[Previous]
[Contents]
[Next]

tcdropline()

disconnect a communications line

Synopsis:

#include <termios.h>
int tcdropline( int fd, int duration );

Description:

The tcdropline() function initiates a disconnect condition on the communication line associated with the opened file descriptor indicated by fd.

The disconnect condition will be approximately 300 milliseconds if duration is zero, otherwise the condition will last for at least duration milliseconds. The system will round 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 fd is invalid.
ENOSYS
The resource manager associated with fd doesn't support this call.
ENOTTY
The argument fd 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 );

    /*
     * Disconnect for 500 milliseconds
     */
    tcdropline( fd, 500 );

    close( fd );
  }

Classification:

QNX

Safety:
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

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


[Previous]
[Contents]
[Next]