Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

tcdrain - wait for transmission of output

&pagelevel(4)&pagelevel

Syntax

#include <termios.h>

int tcdrain (int fildes);

Description

tcdrain() waits until all output written to the object specified by fildes is transmitted. The fildes argument is an open file descriptor associated with a terminal.

Any attempts to use tcdrain() from a process which is a member of a background process group on a fildes associated with its controlling terminal, will cause the process group to be sent a SIGTTOU signal. If the calling process is blocking or ignoring SIGTTOU signals, the process is allowed to perform the operation, and no signal is sent.

Return val.

0

-1

if successful.

If an error occurs. errno is set to indicate the error.

Errors

tcdrain() will fail if:

 

EBADF

fildes is not a valid file descriptor.

 

EINTR

A signal was caught during the tcdrain() system call.

 

Extension


 

EINVAL

An attempt was made to access a BS2000 file. (End)

 

EIO

The process group of the writing process is orphaned, and the writing process is not ignoring or blocking SIGTTOU.

 

ENOTTY

The file associated with fildes is not a terminal.

Notes

tcdrain() has no effect on block-mode terminals.

See also

tcflush(), termios.h, unistd.h, section “General terminal interface”.