1tcdrain(3C) Standard C Library Functions tcdrain(3C)
2
3
4
6 tcdrain - wait for transmission of output
7
9 #include <termios.h>
10
11 int tcdrain(int fildes);
12
13
15 The tcdrain() function waits until all output written to the object
16 referred to by fildes is transmitted. The fildes argument is an open
17 file descriptor associated with a terminal.
18
19
20 Any attempts to use tcdrain() from a process which is a member of a
21 background process group on a fildes associated with its controlling
22 terminal, will cause the process group to be sent a SIGTTOU signal. If
23 the calling process is blocking or ignoring SIGTTOU signals, the
24 process is allowed to perform the operation, and no signal is sent.
25
27 Upon successful completion, 0 is returned. Otherwise, −1 is returned
28 and errno is set to indicate the error.
29
31 The tcdrain() function will fail if:
32
33 EBADF The fildes argument is not a valid file descriptor.
34
35
36 EINTR A signal interrupted tcdrain().
37
38
39 ENOTTY The file associated with fildes is not a terminal.
40
41
42
43 The tcdrain() function may fail if:
44
45 EIO The process group of the writing process is orphaned, and the
46 writing process is not ignoring or blocking SIGTTOU.
47
48
50 See attributes(5) for descriptions of the following attributes:
51
52
53
54
55 ┌─────────────────────────────┬───────────────────────────────┐
56 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
57 ├─────────────────────────────┼───────────────────────────────┤
58 │Interface Stability │Standard │
59 ├─────────────────────────────┼───────────────────────────────┤
60 │MT-Level │MT-Safe, and Async-Signal-Safe │
61 └─────────────────────────────┴───────────────────────────────┘
62
64 tcflush(3C), attributes(5), standards(5), termio(7I)
65
66
67
68SunOS 5.11 14 Aug 2002 tcdrain(3C)