OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man2 / wait.2
index 5908214..3943394 100644 (file)
@@ -46,7 +46,7 @@
 .\" 2005-05-10, mtk, __W* flags can't be used with waitid()
 .\" 2008-07-04, mtk, removed erroneous text about SA_NOCLDSTOP
 .\"
-.TH WAIT 2 2012-12-21 "Linux" "Linux Programmer's Manual"
+.TH WAIT 2 2014-08-19 "Linux" "Linux Programmer's Manual"
 .SH NAME
 wait, waitpid, waitid \- wait for process to change state
 .SH SYNOPSIS
@@ -60,6 +60,8 @@ wait, waitpid, waitid \- wait for process to change state
 
 .BI "int waitid(idtype_t " idtype ", id_t " id \
 ", siginfo_t *" infop ", int " options );
+                /* This is the glibc and POSIX interface; see
+                   NOTES for information on the raw system call. */
 .sp
 .in -4n
 Feature Test Macro Requirements for glibc (see
@@ -90,7 +92,7 @@ if a wait is not performed, then the terminated child remains in
 a "zombie" state (see NOTES below).
 
 If a child has already changed state, then these calls return immediately.
-Otherwise they block until either a child changes state or
+Otherwise, they block until either a child changes state or
 a signal handler interrupts the call (assuming that system calls
 are not automatically restarted using the
 .B SA_RESTART
@@ -372,10 +374,11 @@ was specified and no child(ren) specified by
 .I id
 has yet changed state;
 on error, \-1 is returned.
-.\" FIXME: As reported by Vegard Nossum, if infop is NULL, then waitid()
+.\" FIXME As reported by Vegard Nossum, if infop is NULL, then waitid()
 .\" returns the PID of the child.  Either this is a bug, or it is intended
 .\" behavior that needs to be documented.  See my Jan 2009 LKML mail
 .\" "waitid() return value strangeness when infop is NULL".
+.PP
 Each of these calls sets
 .I errno
 to an appropriate value in the case of an error.
@@ -430,7 +433,7 @@ it will consume a slot in the kernel process table, and if
 this table fills, it will not be possible to create further processes.
 If a parent process terminates, then its "zombie" children (if any)
 are adopted by
-.BR init (8),
+.BR init (1),
 which automatically performs a wait to remove the zombies.
 
 POSIX.1-2001 specifies that if the disposition of
@@ -461,7 +464,8 @@ Note that even though the default disposition of
 is "ignore", explicitly setting the disposition to
 .B SIG_IGN
 results in different treatment of zombie process children.)
-Linux 2.6 conforms to this specification.
+
+Linux 2.6 conforms to the POSIX requirements.
 However, Linux 2.4 (and earlier) does not:
 if a
 .BR wait ()
@@ -500,7 +504,7 @@ they cannot be used with
 .B __WCLONE
 .\" since 0.99pl10
 Wait for "clone" children only.
-If omitted then wait for "non-clone" children only.
+If omitted, then wait for "non-clone" children only.
 (A "clone" child is one which delivers no signal, or a signal other than
 .B SIGCHLD
 to its parent upon termination.)
@@ -518,6 +522,18 @@ type ("clone" or "non-clone").
 Do not wait for children of other threads in
 the same thread group.
 This was the default before Linux 2.4.
+.SS C library/kernel ABI differences
+The raw
+.BR waitid ()
+system call takes a fifth argument, of type
+.IR "struct rusage\ *" .
+If this argument is non-NULL,
+then it is used to return resource usage information about the child,
+in the same manner as
+.BR wait4 (2).
+See
+.BR getrusage (2)
+for details.
 .SH BUGS
 According to POSIX.1-2008, an application calling
 .BR waitid ()
@@ -525,7 +541,7 @@ must ensure that
 .I infop
 points to a
 .I siginfo_t
-structure (i.e., that it is a non-NULL pointer).
+structure (i.e., that it is a non-null pointer).
 On Linux, if
 .I infop
 is NULL,
@@ -628,3 +644,12 @@ main(int argc, char *argv[])
 .BR pthread_create (3),
 .BR credentials (7),
 .BR signal (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.