summaryrefslogtreecommitdiff
path: root/manual/terminal.texi
diff options
context:
space:
mode:
Diffstat (limited to 'manual/terminal.texi')
-rw-r--r--manual/terminal.texi8
1 files changed, 8 insertions, 0 deletions
diff --git a/manual/terminal.texi b/manual/terminal.texi
index fcd30a11aa..7e0f985220 100644
--- a/manual/terminal.texi
+++ b/manual/terminal.texi
@@ -1638,6 +1638,14 @@ The @var{filedes} is not associated with a terminal device.
The @code{tcdrain} function waits until all queued
output to the terminal @var{filedes} has been transmitted.
+This function is a cancelation point in multi-threaded programs. This
+is a problem if the thread allocates some resources (like memory, file
+descriptors, semaphores or whatever) at the time @code{tcdrain} is
+called. If the thread gets canceled these resources stay allocated
+until the program ends. To avoid this calls to @code{tcdrain} should be
+protected using cancelation handlers.
+@c ref pthread_cleanup_push / pthread_cleanup_pop
+
The return value is normally zero. In the event of an error, a value
of @code{-1} is returned. The following @code{errno} error conditions
are defined for this function: