Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31e5e37

Browse files
committed
Explain the possible range of values for the pid parameter to
waitpid().
1 parent af57251 commit 31e5e37

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

Doc/lib/libos.tex

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,12 +745,20 @@ \subsection{Process Management \label{os-process}}
745745
\end{funcdesc}
746746

747747
\begin{funcdesc}{waitpid}{pid, options}
748-
Wait for completion of a child process given by process id, and return
749-
a tuple containing its process id and exit status indication (encoded
750-
as for \function{wait()}). The semantics of the call are affected by
751-
the value of the integer \var{options}, which should be \code{0} for
752-
normal operation.
753-
Availability: \UNIX{}.
748+
Wait for completion of a child process given by process id \var{pid},
749+
and return a tuple containing its process id and exit status
750+
indication (encoded as for \function{wait()}). The semantics of the
751+
call are affected by the value of the integer \var{options}, which
752+
should be \code{0} for normal operation.
753+
Availability: \UNIX{}.
754+
755+
If \var{pid} is greater than \code{0}, \function{waitpid()} requests
756+
status information for that specific process. If \var{pid} is
757+
\code{0}, the request is for the status of any child in the process
758+
group of the current process. If \var{pid} is \code{-1}, the request
759+
pertains to any child of the current process. If \var{pid} is less
760+
than \code{-1}, status is requested for any process in the process
761+
group \code{-\var{pid}} (the absolute value of \var{pid}).
754762
\end{funcdesc}
755763

756764
\begin{datadesc}{WNOHANG}

0 commit comments

Comments
 (0)