1TCDRAIN(3P) POSIX Programmer's Manual TCDRAIN(3P)
2
3
4
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
11
13 tcdrain — wait for transmission of output
14
16 #include <termios.h>
17
18 int tcdrain(int fildes);
19
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.
28 If the calling thread is blocking SIGTTOU signals or the process is
29 ignoring SIGTTOU signals, the process shall be allowed to perform the
30 operation, and no signal is sent.
31
33 Upon successful completion, 0 shall be returned. Otherwise, −1 shall be
34 returned and errno set to indicate the error.
35
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 EIO The process group of the writing process is orphaned, the call‐
44 ing thread is not blocking SIGTTOU, and the process is not
45 ignoring SIGTTOU.
46
47 ENOTTY The file associated with fildes is not a terminal.
48
49 The following sections are informative.
50
52 None.
53
55 None.
56
58 None.
59
61 None.
62
64 tcflush()
65
66 The Base Definitions volume of POSIX.1‐2008, Chapter 11, General Termi‐
67 nal Interface, <termios.h>
68
70 Portions of this text are reprinted and reproduced in electronic form
71 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
72 -- Portable Operating System Interface (POSIX), The Open Group Base
73 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
74 cal and Electronics Engineers, Inc and The Open Group. (This is
75 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) 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.unix.org/online.html .
80
81 Any typographical or formatting errors that appear in this page are
82 most likely to have been introduced during the conversion of the source
83 files to man page format. To report such errors, see https://www.ker‐
84 nel.org/doc/man-pages/reporting_bugs.html .
85
86
87
88IEEE/The Open Group 2013 TCDRAIN(3P)