man-pages/man0p/sys_wait.h.0p

123 lines
3.2 KiB
Plaintext

.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.TH "<sys/wait.h>" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\" <sys/wait.h>
.SH NAME
sys/wait.h \- declarations for waiting
.SH SYNOPSIS
.LP
\fB#include <sys/wait.h>\fP
.SH DESCRIPTION
.LP
The \fI<sys/wait.h>\fP header shall define the following symbolic
constants for use with \fIwaitpid\fP():
.TP 7
WNOHANG
Do not hang if no status is available; return immediately.
.TP 7
WUNTRACED
Report status of stopped child process.
.sp
.LP
The \fI<sys/wait.h>\fP header shall define the following macros for
analysis of process status values:
.TP 7
WEXITSTATUS
Return exit status.
.TP 7
WIFCONTINUED
True if child has been continued.
.TP 7
WIFEXITED
True if child exited normally.
.TP 7
WIFSIGNALED
True if child exited due to uncaught signal.
.TP 7
WIFSTOPPED
True if child is currently stopped.
.TP 7
WSTOPSIG
Return signal number that caused process to stop.
.TP 7
WTERMSIG
Return signal number that caused process to terminate.
.sp
.LP
The following symbolic constants shall be defined as possible values
for the \fIoptions\fP argument to \fIwaitid\fP():
.TP 7
WEXITED
Wait for processes that have exited.
.TP 7
WSTOPPED
Status is returned for any child that has stopped upon receipt of
a signal.
.TP 7
WCONTINUED
Status is returned for any child that was stopped and has been continued.
.TP 7
WNOHANG
Return immediately if there are no children to wait for.
.TP 7
WNOWAIT
Keep the process whose status is returned in \fIinfop\fP in a waitable
state.
.sp
.LP
The type \fBidtype_t\fP shall be defined as an enumeration type whose
possible values shall include at least the following:
P_ALL P_PID P_PGID
.LP
The \fBid_t\fP and \fBpid_t\fP types shall be defined as described
in \fI<sys/types.h>\fP .
.LP
The \fBsiginfo_t\fP type shall be defined as described in \fI<signal.h>\fP
\&.
.LP
The \fBrusage\fP structure shall be defined as described in \fI<sys/resource.h>\fP
\&.
.LP
Inclusion of the \fI<sys/wait.h>\fP header may also make visible all
symbols from \fI<signal.h>\fP and \fI<sys/resource.h>\fP.
.LP
The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided.
.sp
.RS
.nf
\fBpid_t wait(int *);
int waitid(idtype_t, id_t, siginfo_t *, int);
pid_t waitpid(pid_t, int *, int);
\fP
.fi
.RE
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fI<signal.h>\fP , \fI<sys/resource.h>\fP , \fI<sys/types.h>\fP ,
the System Interfaces volume of IEEE\ Std\ 1003.1-2001, \fIwait\fP(),
\fIwaitid\fP()
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. In the
event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .