add lint
[unix-history] / usr / src / old / man / wait3.2j
CommitLineData
bbf12550
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)wait3.2j 4.1 (Berkeley) %G%
6.\"
7.TH WAIT3 2J
8.UC 4
9.SH NAME
10wait3 \- wait for process to terminate
11.SH SYNOPSIS
12.nf
13.B "#include <wait.h>"
14.B "#include <sys/vtimes.h>"
15.PP
16.B wait3(status, options, vtimep)
17.B union wait status;
18.B int options;
19.B struct vtimes *vtimep;
20.PP
21.B cc ... \-ljobs
22.fi
23.SH DESCRIPTION
24The
25.I status
26and
27.I option
28words are described by definitions and macros in the file
29<wait.h>; the union and its bitfield definitions and associated
30macros given there provide
31convenient and mnemonic access to the word of status returned by a
32.I wait3
33call.
34See this file for more information.
35.PP
36There are two
37.I options,
38which may be combined by
39.IR or ing
40them together.
41The first is WNOHANG which causes the
42.I wait3
43to not hang if there are no
44processes which wish to report status, rather returning a pid of 0 in this
45case as the result of the
46.I wait3.
47The second option is WUNTRACED which causes
48.I wait3
49to return information when children of the current process which are
50stopped but not traced (with
51.IR ptrace (2))
52because they received a SIGTTIN, SIGTTOU, SIGTSTP or SIGSTOP signal.
53See
54.IR sigsys (2))
55for a description of these signals.
56.PP
57The
58.I vtimep
59pointer is an optional structure where a
60.I vtimes
61structure is returned describing the resources used by the terminated
62process and all its children. This may be given as \*(lq0\*(rq if the
63information is not desired. Currently this information is not available
64for stopped processes.
65.SH "SEE ALSO"
66wait(2), exit(2), fork(2), sigsys(2)
67.SH DIAGNOSTICS
68Returns
69\-1 if there are no children not previously waited for, or 0 if the WNOHANG
70option is given and there are no stopped or exited children.
71.SH BUGS
72This call is peculiar to this version of UNIX.
73The options and specifications of this system call and even the call itself
74are subject to change. It may be replaced by other facilities in future
75versions of the system.