]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/wait.2
dlopen.3: Make it more explicit that LD_BIND_NOW overrides RTLD_LAZY
[thirdparty/man-pages.git] / man2 / wait.2
CommitLineData
1130df60 1.\" Copyright (c) 1993 by Thomas Koenig <ig25@rz.uni-karlsruhe.de>
c11b1abf 2.\" and Copyright (c) 2004 by Michael Kerrisk <mtk.manpages@gmail.com>
fea681da 3.\"
93015253 4.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
8.\"
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one.
c13182ef 13.\"
fea681da
MK
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date. The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein. The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
c13182ef 21.\"
fea681da
MK
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 24.\" %%%LICENSE_END
fea681da
MK
25.\"
26.\" Modified Sat Jul 24 13:30:06 1993 by Rik Faith <faith@cs.unc.edu>
27.\" Modified Sun Aug 21 17:42:42 1994 by Rik Faith <faith@cs.unc.edu>
28.\" (Thanks to Koen Holtman <koen@win.tue.nl>)
29.\" Modified Wed May 17 15:54:12 1995 by Rik Faith <faith@cs.unc.edu>
30.\" To remove *'s from status in macros (Thanks to Michael Shields).
31.\" Modified as suggested by Nick Duffek <nsd@bbc.com>, aeb, 960426
32.\" Modified Mon Jun 23 14:09:52 1997 by aeb - add EINTR.
33.\" Modified Thu Nov 26 02:12:45 1998 by aeb - add SIGCHLD stuff.
34.\" Modified Mon Jul 24 21:37:38 2000 by David A. Wheeler
35.\" <dwheeler@dwheeler.com> - noted thread issues.
36.\" Modified 26 Jun 01 by Michael Kerrisk
37.\" Added __WCLONE, __WALL, and __WNOTHREAD descriptions
38.\" Modified 2001-09-25, aeb
c11b1abf 39.\" Modified 26 Jun 01 by Michael Kerrisk, <mtk.manpages@gmail.com>
fea681da 40.\" Updated notes on setting disposition of SIGCHLD to SIG_IGN
599be3ee
MK
41.\" 2004-11-11, mtk
42.\" Added waitid(2); added WCONTINUED and WIFCONTINUED()
f2351505 43.\" Added text on SA_NOCLDSTOP
d9bfdb9c 44.\" Updated discussion of SA_NOCLDWAIT to reflect 2.6 behavior
f2351505 45.\" Much other text rewritten
948fb4ed 46.\" 2005-05-10, mtk, __W* flags can't be used with waitid()
21399189 47.\" 2008-07-04, mtk, removed erroneous text about SA_NOCLDSTOP
fea681da 48.\"
5722c835 49.TH WAIT 2 2015-07-23 "Linux" "Linux Programmer's Manual"
fea681da 50.SH NAME
0bfa087b 51wait, waitpid, waitid \- wait for process to change state
fea681da
MK
52.SH SYNOPSIS
53.B #include <sys/types.h>
54.br
55.B #include <sys/wait.h>
56.sp
57.BI "pid_t wait(int *" "status" );
5895e7eb 58
fea681da 59.BI "pid_t waitpid(pid_t " pid ", int *" status ", int " options );
5895e7eb 60
c10859eb
MK
61.BI "int waitid(idtype_t " idtype ", id_t " id \
62", siginfo_t *" infop ", int " options );
d8b13fb4
MK
63 /* This is the glibc and POSIX interface; see
64 NOTES for information on the raw system call. */
cc4615cc
MK
65.sp
66.in -4n
67Feature Test Macro Requirements for glibc (see
68.BR feature_test_macros (7)):
69.in
70.sp
6e3ac6ba
MK
71.ad l
72.PD 0
cc4615cc 73.BR waitid ():
6e3ac6ba 74.RS 4
6e3ac6ba
MK
75_SVID_SOURCE ||
76_XOPEN_SOURCE\ >=\ 500 ||
77_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
3ba63d80
MK
78.br
79|| /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
6e3ac6ba
MK
80.RE
81.PD
82.ad
fea681da 83.SH DESCRIPTION
f2351505
MK
84All of these system calls are used to wait for state changes
85in a child of the calling process, and obtain information
86about the child whose state has changed.
87A state change is considered to be: the child terminated;
88the child was stopped by a signal; or the child was resumed by a signal.
89In the case of a terminated child, performing a wait allows
90the system to release the resources associated with the child;
f946c580 91if a wait is not performed, then the terminated child remains in
f2351505
MK
92a "zombie" state (see NOTES below).
93
94If a child has already changed state, then these calls return immediately.
2b9b829d 95Otherwise, they block until either a child changes state or
f2351505
MK
96a signal handler interrupts the call (assuming that system calls
97are not automatically restarted using the
98.B SA_RESTART
99flag of
100.BR sigaction (2)).
101In the remainder of this page, a child whose state has changed
c13182ef 102and which has not yet been waited upon by one of these system
d3b2ef5d 103calls is termed
f2351505 104.IR waitable .
73d8cece 105.SS wait() and waitpid()
fea681da 106The
f2351505 107.BR wait ()
a1ffe9f5 108system call suspends execution of the calling process until one of its
f2351505
MK
109children terminates.
110The call
111.I wait(&status)
112is equivalent to:
113.nf
114
2bc2f479 115 waitpid(\-1, &status, 0);
f2351505 116.fi
fea681da
MK
117
118The
f2351505 119.BR waitpid ()
a1ffe9f5 120system call suspends execution of the calling process until a
f2351505 121child specified by
fea681da 122.I pid
f2351505
MK
123argument has changed state.
124By default,
125.BR waitpid ()
d9bfdb9c 126waits only for terminated children, but this behavior is modifiable
f2351505
MK
127via the
128.I options
129argument, as described below.
fea681da
MK
130
131The value of
132.I pid
f2351505 133can be:
fea681da 134.IP "< \-1"
f2351505 135meaning wait for any child process whose process group ID is
fea681da
MK
136equal to the absolute value of
137.IR pid .
138.IP \-1
f2351505 139meaning wait for any child process.
fea681da 140.IP 0
f2351505 141meaning wait for any child process whose process group ID is
fea681da
MK
142equal to that of the calling process.
143.IP "> 0"
f2351505 144meaning wait for the child whose process ID is equal to the
fea681da
MK
145value of
146.IR pid .
147.PP
148The value of
149.I options
150is an OR of zero or more of the following constants:
a325cc60 151.TP 12
fea681da 152.B WNOHANG
f2351505 153return immediately if no child has exited.
fea681da
MK
154.TP
155.B WUNTRACED
d3b2ef5d 156also return if a child has stopped
f2351505 157(but not traced via
d3b2ef5d
MK
158.BR ptrace (2)).
159Status for
160.I traced
161children which have stopped is provided
162even if this option is not specified.
f2351505 163.TP
31daf529 164.BR WCONTINUED " (since Linux 2.6.10)"
d3b2ef5d 165also return if a stopped child has been resumed by delivery of
f2351505 166.BR SIGCONT .
fea681da
MK
167.PP
168(For Linux-only options, see below.)
169.PP
170If
171.I status
8478ee02 172is not NULL,
f2351505
MK
173.BR wait ()
174and
175.BR waitpid ()
a8d55537 176store status information in the \fIint\fP to which it points.
f2351505
MK
177This integer can be inspected with the following macros (which
178take the integer itself as an argument, not a pointer to it,
179as is done in
180.BR wait ()
181and
182.BR waitpid ()!):
fea681da
MK
183.TP
184.BI WIFEXITED( status )
185returns true if the child terminated normally, that is,
f2351505
MK
186by calling
187.BR exit (3)
188or
a5e0a0e4 189.BR _exit (2),
f2351505 190or by returning from main().
fea681da
MK
191.TP
192.BI WEXITSTATUS( status )
f2351505
MK
193returns the exit status of the child.
194This consists of the least significant 8 bits of the
195.I status
196argument that the child specified in a call to
0bfa087b 197.BR exit (3)
f2351505 198or
0bfa087b 199.BR _exit (2)
f2351505 200or as the argument for a return statement in main().
33a0ccb2 201This macro should be employed only if
fea681da
MK
202.B WIFEXITED
203returned true.
204.TP
205.BI WIFSIGNALED( status )
f2351505 206returns true if the child process was terminated by a signal.
fea681da
MK
207.TP
208.BI WTERMSIG( status )
209returns the number of the signal that caused the child process to
c13182ef 210terminate.
33a0ccb2 211This macro should be employed only if
f2351505
MK
212.B WIFSIGNALED
213returned true.
214.TP
215.BI WCOREDUMP( status )
216returns true if the child produced a core dump.
33a0ccb2 217This macro should be employed only if
fea681da 218.B WIFSIGNALED
f2351505
MK
219returned true.
220This macro is not specified in POSIX.1-2001 and is not available on
008f1ecc 221some UNIX implementations (e.g., AIX, SunOS).
f2351505 222Only use this enclosed in #ifdef WCOREDUMP ... #endif.
fea681da
MK
223.TP
224.BI WIFSTOPPED( status )
f2351505 225returns true if the child process was stopped by delivery of a signal;
33a0ccb2 226this is possible only if the call was done using
0daa9e92 227.B WUNTRACED
fea681da
MK
228or when the child is being traced (see
229.BR ptrace (2)).
230.TP
231.BI WSTOPSIG( status )
c13182ef 232returns the number of the signal which caused the child to stop.
33a0ccb2 233This macro should be employed only if
fea681da 234.B WIFSTOPPED
f2351505
MK
235returned true.
236.TP
237.BI WIFCONTINUED( status )
31daf529 238(since Linux 2.6.10)
f2351505
MK
239returns true if the child process was resumed by delivery of
240.BR SIGCONT .
73d8cece 241.SS waitid()
f2351505
MK
242The
243.BR waitid ()
244system call (available since Linux 2.6.9) provides more precise
245control over which child state changes to wait for.
246
247The
248.I idtype
249and
250.I id
251arguments select the child(ren) to wait for, as follows:
252.IP "\fIidtype\fP == \fBP_PID\fP"
253Wait for the child whose process ID matches
254.IR id .
255.IP "\fIidtype\fP == \fBP_PGID\fP"
256Wait for any child whose process group ID matches
257.IR id .
258.IP "\fIidtype\fP == \fBP_ALL\fP"
259Wait for any child;
260.I id
261is ignored.
262.PP
263The child state changes to wait for are specified by ORing
264one or more of the following flags in
265.IR options :
a325cc60 266.TP 12
f2351505
MK
267.B WEXITED
268Wait for children that have terminated.
269.TP
270.B WSTOPPED
271Wait for children that have been stopped by delivery of a signal.
272.TP
273.B WCONTINUED
274Wait for (previously stopped) children that have been
275resumed by delivery of
276.BR SIGCONT .
277.PP
278The following flags may additionally be ORed in
279.IR options :
a325cc60 280.TP 12
f2351505
MK
281.B WNOHANG
282As for
283.BR waitpid ().
284.TP
285.B WNOWAIT
286Leave the child in a waitable state; a later wait call
287can be used to again retrieve the child status information.
288.PP
289Upon successful return,
290.BR waitid ()
291fills in the following fields of the
292.I siginfo_t
293structure pointed to by
294.IR infop :
a325cc60
MK
295.TP 12
296\fIsi_pid\fP
f2351505 297The process ID of the child.
a325cc60
MK
298.TP
299\fIsi_uid\fP
f2351505 300The real user ID of the child.
04d6ea6b 301(This field is not set on most other implementations.)
a325cc60
MK
302.TP
303\fIsi_signo\fP
f2351505
MK
304Always set to
305.BR SIGCHLD .
a325cc60
MK
306.TP
307\fIsi_status\fP
f2351505
MK
308Either the exit status of the child, as given to
309.BR _exit (2)
310(or
311.BR exit (3)),
312or the signal that caused the child to terminate, stop, or continue.
c13182ef 313The
f2351505
MK
314.I si_code
315field can be used to determine how to interpret this field.
a325cc60
MK
316.TP
317\fIsi_code\fP
f2351505
MK
318Set to one of:
319.B CLD_EXITED
320(child called
321.BR _exit (2));
322.B CLD_KILLED
323(child killed by signal);
73ac11ee
GK
324.B CLD_DUMPED
325(child killed by signal, and dumped core);
f2351505 326.B CLD_STOPPED
73ac11ee
GK
327(child stopped by signal);
328.B CLD_TRAPPED
329(traced child has trapped); or
f2351505
MK
330.B CLD_CONTINUED
331(child continued by
332.BR SIGCONT ).
333.PP
334If
335.B WNOHANG
336was specified in
337.I options
338and there were no children in a waitable state, then
339.BR waitid ()
340returns 0 immediately and
341the state of the
342.I siginfo_t
343structure pointed to by
344.I infop
345is unspecified.
c13182ef 346.\" POSIX.1-2001 leaves this possibility unspecified; most
f2351505 347.\" implementations (including Linux) zero out the structure
66d90115 348.\" in this case, but at least one implementation (AIX 5.1)
f2351505
MK
349.\" does not -- MTK Nov 04
350To distinguish this case from that where a child was in a
351waitable state, zero out the
352.I si_pid
c7094399 353field before the call and check for a nonzero value in this field
f2351505 354after the call returns.
47297adb 355.SH RETURN VALUE
f2351505 356.BR wait ():
d3b2ef5d 357on success, returns the process ID of the terminated child;
f2351505
MK
358on error, \-1 is returned.
359
a5e0a0e4 360.BR waitpid ():
d3b2ef5d 361on success, returns the process ID of the child whose state has changed;
f2351505 362if
fea681da 363.B WNOHANG
55ae3c86 364was specified and one or more child(ren) specified by
f2351505 365.I pid
55ae3c86
MK
366exist, but have not yet changed state, then 0 is returned.
367On error, \-1 is returned.
f2351505 368
a5e0a0e4 369.BR waitid ():
c13182ef 370returns 0 on success or
f2351505
MK
371if
372.B WNOHANG
373was specified and no child(ren) specified by
374.I id
375has yet changed state;
376on error, \-1 is returned.
bea08fec 377.\" FIXME As reported by Vegard Nossum, if infop is NULL, then waitid()
47f442b2 378.\" returns the PID of the child. Either this is a bug, or it is intended
74ee79b9 379.\" behavior that needs to be documented. See my Jan 2009 LKML mail
47f442b2 380.\" "waitid() return value strangeness when infop is NULL".
3252fa3f 381.PP
f2351505 382Each of these calls sets
fea681da 383.I errno
f2351505 384to an appropriate value in the case of an error.
fea681da
MK
385.SH ERRORS
386.TP
0daa9e92 387.B ECHILD
c13182ef 388(for
e1d6264d 389.BR wait ())
fea681da
MK
390The calling process does not have any unwaited-for children.
391.TP
0daa9e92 392.B ECHILD
c13182ef
MK
393(for
394.BR waitpid ()
395or
e1d6264d 396.BR waitid ())
f2351505 397The process specified by
fea681da 398.I pid
f2351505
MK
399.RB ( waitpid ())
400or
401.I idtype
402and
403.I id
404.RB ( waitid ())
fea681da 405does not exist or is not a child of the calling process.
8bd58774
MK
406(This can happen for one's own child if the action for
407.B SIGCHLD
408is set to
409.BR SIG_IGN .
4fb31341 410See also the \fILinux Notes\fP section about threads.)
fea681da
MK
411.TP
412.B EINTR
413.B WNOHANG
414was not set and an unblocked signal or a
415.B SIGCHLD
01538d0d
MK
416was caught; see
417.BR signal (7).
fea681da
MK
418.TP
419.B EINVAL
420The
421.I options
422argument was invalid.
47297adb 423.SH CONFORMING TO
2dd578fd 424SVr4, 4.3BSD, POSIX.1-2001.
fea681da 425.SH NOTES
f2351505
MK
426A child that terminates, but has not been waited for becomes a "zombie".
427The kernel maintains a minimal set of information about the zombie
428process (PID, termination status, resource usage information)
429in order to allow the parent to later perform a wait to obtain
430information about the child.
431As long as a zombie is not removed from the system via a wait,
432it will consume a slot in the kernel process table, and if
433this table fills, it will not be possible to create further processes.
434If a parent process terminates, then its "zombie" children (if any)
435are adopted by
e8906093 436.BR init (1),
f2351505
MK
437which automatically performs a wait to remove the zombies.
438
439POSIX.1-2001 specifies that if the disposition of
440.B SIGCHLD
c13182ef 441is set to
f2351505 442.B SIG_IGN
c13182ef 443or the
f2351505
MK
444.B SA_NOCLDWAIT
445flag is set for
0daa9e92 446.B SIGCHLD
c13182ef 447(see
f2351505
MK
448.BR sigaction (2)),
449then children that terminate do not become zombies and a call to
fea681da
MK
450.BR wait ()
451or
452.BR waitpid ()
f2351505 453will block until all children have terminated, and then fail with
fea681da 454.I errno
f2351505
MK
455set to
456.BR ECHILD .
d9bfdb9c 457(The original POSIX standard left the behavior of setting
f2351505
MK
458.B SIGCHLD
459to
460.B SIG_IGN
0e464c2f
MK
461unspecified.
462Note that even though the default disposition of
463.B SIGCHLD
464is "ignore", explicitly setting the disposition to
465.B SIG_IGN
466results in different treatment of zombie process children.)
3818a4f1
MK
467
468Linux 2.6 conforms to the POSIX requirements.
f2351505 469However, Linux 2.4 (and earlier) does not:
fea681da 470if a
c13182ef
MK
471.BR wait ()
472or
e1d6264d 473.BR waitpid ()
f2351505
MK
474call is made while
475.B SIGCHLD
476is being ignored, the call behaves just as though
477.B SIGCHLD
704a18f0 478were not being ignored, that is, the call blocks until the next child
d3b2ef5d 479terminates and then returns the process ID and status of that child.
c634028a 480.SS Linux notes
fea681da 481In the Linux kernel, a kernel-scheduled thread is not a distinct
c13182ef
MK
482construct from a process.
483Instead, a thread is simply a process
fea681da
MK
484that is created using the Linux-unique
485.BR clone (2)
486system call; other routines such as the portable
487.BR pthread_create (3)
488call are implemented using
489.BR clone (2).
490Before Linux 2.4, a thread was just a special case of a process,
491and as a consequence one thread could not wait on the children
492of another thread, even when the latter belongs to the same thread group.
493However, POSIX prescribes such functionality, and since Linux 2.4
494a thread can, and by default will, wait on children of other threads
495in the same thread group.
496.LP
8382f16d 497The following Linux-specific
fea681da
MK
498.I options
499are for use with children created using
948fb4ed
MK
500.BR clone (2);
501they cannot be used with
502.BR waitid ():
fea681da
MK
503.TP
504.B __WCLONE
505.\" since 0.99pl10
c13182ef 506Wait for "clone" children only.
f14ae16e 507If omitted, then wait for "non-clone" children only.
c13182ef 508(A "clone" child is one which delivers no signal, or a signal other than
fea681da
MK
509.B SIGCHLD
510to its parent upon termination.)
511This option is ignored if
512.B __WALL
513is also specified.
514.TP
31daf529 515.BR __WALL " (since Linux 2.4)"
fea681da 516.\" since patch-2.3.48
31daf529 517Wait for all children, regardless of
fea681da
MK
518type ("clone" or "non-clone").
519.TP
31daf529 520.BR __WNOTHREAD " (since Linux 2.4)"
fea681da 521.\" since patch-2.4.0-test8
31daf529 522Do not wait for children of other threads in
c13182ef
MK
523the same thread group.
524This was the default before Linux 2.4.
0722a578 525.SS C library/kernel differences
7704b6a9
MK
526.BR wait ()
527is actually a library function that (in glibc) is implemented as a call to
528.BR wait4 (2).
529
858f88b8
MK
530Within glibc,
531.\" A waitpid() system call remains, with a comment noting that
532.\" "waitpid() should be * implemented by calling sys_wait4() from libc.a"
533.BR waitpid ()
534is a wrapper function that invokes
535.BR wait (2).
536
d8b13fb4
MK
537The raw
538.BR waitid ()
72896e87 539system call takes a fifth argument, of type
d8b13fb4
MK
540.IR "struct rusage\ *" .
541If this argument is non-NULL,
542then it is used to return resource usage information about the child,
543in the same manner as
544.BR wait4 (2).
545See
546.BR getrusage (2)
547for details.
7484d5a7
MK
548.SH BUGS
549According to POSIX.1-2008, an application calling
550.BR waitid ()
551must ensure that
552.I infop
553points to a
554.I siginfo_t
b437fdd9 555structure (i.e., that it is a non-null pointer).
7484d5a7
MK
556On Linux, if
557.I infop
558is NULL,
559.BR waitid ()
560succeeds, and returns the process ID of the waited-for child.
561Applications should avoid relying on this inconsistent,
562nonstandard, and unnecessary feature.
1fa343d1 563.SH EXAMPLE
cde9f44b 564.\" fork.2 refers to this example program.
c13182ef 565The following program demonstrates the use of
19dbfd0a 566.BR fork (2)
c13182ef 567and
2777b1ca 568.BR waitpid ().
1fa343d1 569The program creates a child process.
c13182ef
MK
570If no command-line argument is supplied to the program,
571then the child suspends its execution using
1fa343d1
MK
572.BR pause (2),
573to allow the user to send signals to the child.
574Otherwise, if a command-line argument is supplied,
c13182ef 575then the child exits immediately,
1fa343d1
MK
576using the integer supplied on the command line as the exit status.
577The parent process executes a loop that monitors the child using
2777b1ca 578.BR waitpid (),
d9bfdb9c 579and uses the W*() macros described above to analyze the wait status value.
1fa343d1
MK
580
581The following shell session demonstrates the use of the program:
9d0cc711 582.in +4n
1fa343d1
MK
583.nf
584
b43a3b30 585.RB "$" " ./a.out &"
1fa343d1
MK
586Child PID is 32360
587[1] 32359
b43a3b30 588.RB "$" " kill \-STOP 32360"
1fa343d1 589stopped by signal 19
b43a3b30 590.RB "$" " kill \-CONT 32360"
1fa343d1 591continued
b43a3b30 592.RB "$" " kill \-TERM 32360"
1fa343d1
MK
593killed by signal 15
594[1]+ Done ./a.out
595$
9d0cc711
MK
596.fi
597.in
9c330504 598.SS Program source
d84d0300 599\&
9d0cc711 600.nf
1fa343d1
MK
601#include <sys/wait.h>
602#include <stdlib.h>
603#include <unistd.h>
604#include <stdio.h>
605
606int
607main(int argc, char *argv[])
608{
609 pid_t cpid, w;
610 int status;
611
612 cpid = fork();
29059a65 613 if (cpid == \-1) {
45949175
MK
614 perror("fork");
615 exit(EXIT_FAILURE);
616 }
1fa343d1
MK
617
618 if (cpid == 0) { /* Code executed by child */
619 printf("Child PID is %ld\\n", (long) getpid());
620 if (argc == 1)
621 pause(); /* Wait for signals */
622 _exit(atoi(argv[1]));
623
624 } else { /* Code executed by parent */
625 do {
626 w = waitpid(cpid, &status, WUNTRACED | WCONTINUED);
29059a65 627 if (w == \-1) {
45949175
MK
628 perror("waitpid");
629 exit(EXIT_FAILURE);
630 }
1fa343d1
MK
631
632 if (WIFEXITED(status)) {
633 printf("exited, status=%d\\n", WEXITSTATUS(status));
634 } else if (WIFSIGNALED(status)) {
635 printf("killed by signal %d\\n", WTERMSIG(status));
636 } else if (WIFSTOPPED(status)) {
637 printf("stopped by signal %d\\n", WSTOPSIG(status));
638 } else if (WIFCONTINUED(status)) {
639 printf("continued\\n");
640 }
641 } while (!WIFEXITED(status) && !WIFSIGNALED(status));
642 exit(EXIT_SUCCESS);
643 }
644}
1fa343d1 645.fi
47297adb 646.SH SEE ALSO
f2351505 647.BR _exit (2),
fea681da 648.BR clone (2),
f2351505
MK
649.BR fork (2),
650.BR kill (2),
fea681da 651.BR ptrace (2),
f2351505 652.BR sigaction (2),
fea681da
MK
653.BR signal (2),
654.BR wait4 (2),
655.BR pthread_create (3),
53a1443c 656.BR credentials (7),
fea681da 657.BR signal (7)