-.\" $OpenBSD: wait.2,v 1.29 2015/11/24 19:34:31 jmc Exp $
+.\" $OpenBSD: wait.2,v 1.30 2017/05/01 00:08:31 millert Exp $
.\" $NetBSD: wait.2,v 1.6 1995/02/27 12:39:37 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
.\"
.\" @(#)wait.2 8.2 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: November 24 2015 $
+.Dd $Mdocdate: May 1 2017 $
.Dt WAIT 2
.Os
.Sh NAME
.Va errno
is set to indicate the error.
.Sh ERRORS
-.Fn wait
+.Fn wait ,
+.Fn waitpid ,
+.Fn wait3 ,
+and
+.Fn wait4
will fail and return immediately if:
.Bl -tag -width Er
.It Bq Er ECHILD
The calling process has no existing unwaited-for child processes.
+.It Bq Er ECHILD
+No status from the terminated child process is available
+because the calling process has asked the system to discard
+such status by ignoring the signal
+.Dv SIGCHLD
+or setting the flag
+.Dv SA_NOCLDWAIT
+for that signal.
.It Bq Er EFAULT
The
.Fa status
The call was interrupted by a caught signal, or the signal did not have the
.Dv SA_RESTART
flag set.
+.El
+.Pp
+.Fn waitpid
+and
+.Fn wait4
+will fail and return immediately if:
+.Bl -tag -width Er
+.It Bq Er ECHILD
+The process specified by the
+.Ar wpid
+argument does not exist or is not a child of the calling process.
.It Bq Er EINVAL
Invalid or undefined flags were passed in the
.Fa options