aboutsummaryrefslogtreecommitdiff
path: root/manual/process.texi
diff options
context:
space:
mode:
Diffstat (limited to 'manual/process.texi')
-rw-r--r--manual/process.texi24
1 files changed, 24 insertions, 0 deletions
diff --git a/manual/process.texi b/manual/process.texi
index d382df5df1..43230154f6 100644
--- a/manual/process.texi
+++ b/manual/process.texi
@@ -62,6 +62,14 @@ possible to create the shell process, and otherwise is the status of the
shell process. @xref{Process Completion}, for details on how this
status code can be interpreted.
+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{system} is
+called. If the thread gets canceled these resources stay allocated
+until the program ends. To avoid this calls to @code{system} should be
+protected using cancelation handlers.
+@c ref pthread_cleanup_push / pthread_cleanup_pop
+
@pindex stdlib.h
The @code{system} function is declared in the header file
@file{stdlib.h}.
@@ -477,6 +485,14 @@ processes as well as processes that have terminated.
The status information from the child process is stored in the object
that @var{status-ptr} points to, unless @var{status-ptr} is a null pointer.
+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{waitpid} is
+called. If the thread gets canceled these resources stay allocated
+until the program ends. To avoid this calls to @code{waitpid} should be
+protected using cancelation handlers.
+@c ref pthread_cleanup_push / pthread_cleanup_pop
+
The return value is normally the process ID of the child process whose
status is reported. If the @code{WNOHANG} option was specified and no
child process is waiting to be noticed, the value is zero. A value of
@@ -547,6 +563,14 @@ is exactly equivalent to:
@smallexample
waitpid (-1, &status, 0)
@end smallexample
+
+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{wait} is
+called. If the thread gets canceled these resources stay allocated
+until the program ends. To avoid this calls to @code{wait} should be
+protected using cancelation handlers.
+@c ref pthread_cleanup_push / pthread_cleanup_pop
@end deftypefun
@comment sys/wait.h