1TCDRAIN(3P)                POSIX Programmer's Manual               TCDRAIN(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       tcdrain - wait for transmission of output
13

SYNOPSIS

15       #include <termios.h>
16
17       int tcdrain(int fildes);
18
19

DESCRIPTION

21       The tcdrain() function shall block until  all  output  written  to  the
22       object referred to by fildes is transmitted.  The fildes argument is an
23       open file descriptor associated with a terminal.
24
25       Any attempts to use tcdrain() from a process which is  a  member  of  a
26       background  process  group  on a fildes associated with its controlling
27       terminal, shall cause the process group to be sent a SIGTTOU signal. If
28       the  calling  process  is  blocking  or  ignoring  SIGTTOU signals, the
29       process shall be allowed to perform the operation,  and  no  signal  is
30       sent.
31

RETURN VALUE

33       Upon successful completion, 0 shall be returned. Otherwise, -1 shall be
34       returned and errno set to indicate the error.
35

ERRORS

37       The tcdrain() function shall fail if:
38
39       EBADF  The fildes argument is not a valid file descriptor.
40
41       EINTR  A signal interrupted tcdrain().
42
43       ENOTTY The file associated with fildes is not a terminal.
44
45
46       The tcdrain() function may fail if:
47
48       EIO    The process group of the writing process is  orphaned,  and  the
49              writing process is not ignoring or blocking SIGTTOU.
50
51
52       The following sections are informative.
53

EXAMPLES

55       None.
56

APPLICATION USAGE

58       None.
59

RATIONALE

61       None.
62

FUTURE DIRECTIONS

64       None.
65

SEE ALSO

67       tcflush(), the Base Definitions volume of IEEE Std 1003.1-2001, Chapter
68       11, General Terminal Interface, <termios.h>, <unistd.h>
69
71       Portions of this text are reprinted and reproduced in  electronic  form
72       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
73       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
74       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
75       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
76       event of any discrepancy between this version and the original IEEE and
77       The Open Group Standard, the original IEEE and The Open Group  Standard
78       is  the  referee document. The original Standard can be obtained online
79       at http://www.opengroup.org/unix/online.html .
80
81
82
83IEEE/The Open Group                  2003                          TCDRAIN(3P)
Impressum