1*01869ca4Swiz.\" $NetBSD: wait.1,v 1.5 2017/07/03 21:30:58 wiz Exp $ 2b41b4b41Sjtc.\" 345c485d1Sjtc.\" Copyright (c) 1991, 1993 445c485d1Sjtc.\" The Regents of the University of California. All rights reserved. 545c485d1Sjtc.\" 645c485d1Sjtc.\" Redistribution and use in source and binary forms, with or without 745c485d1Sjtc.\" modification, are permitted provided that the following conditions 845c485d1Sjtc.\" are met: 945c485d1Sjtc.\" 1. Redistributions of source code must retain the above copyright 1045c485d1Sjtc.\" notice, this list of conditions and the following disclaimer. 1145c485d1Sjtc.\" 2. Redistributions in binary form must reproduce the above copyright 1245c485d1Sjtc.\" notice, this list of conditions and the following disclaimer in the 1345c485d1Sjtc.\" documentation and/or other materials provided with the distribution. 14075022b3Sagc.\" 3. Neither the name of the University nor the names of its contributors 1545c485d1Sjtc.\" may be used to endorse or promote products derived from this software 1645c485d1Sjtc.\" without specific prior written permission. 1745c485d1Sjtc.\" 1845c485d1Sjtc.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1945c485d1Sjtc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2045c485d1Sjtc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2145c485d1Sjtc.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2245c485d1Sjtc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2345c485d1Sjtc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2445c485d1Sjtc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2545c485d1Sjtc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2645c485d1Sjtc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2745c485d1Sjtc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2845c485d1Sjtc.\" SUCH DAMAGE. 2945c485d1Sjtc.\" 3045c485d1Sjtc.\" @(#)wait.1 8.1 (Berkeley) 6/5/93 3145c485d1Sjtc.\" 3245c485d1Sjtc.Dd June 5, 1993 3345c485d1Sjtc.Dt WAIT 1 3445c485d1Sjtc.Os 3545c485d1Sjtc.Sh NAME 3645c485d1Sjtc.Nm wait 3745c485d1Sjtc.Nd await process completion 3845c485d1Sjtc.Sh SYNOPSIS 3945c485d1Sjtc.Nm wait 4045c485d1Sjtc.Op Ar pid 4145c485d1Sjtc.Sh DESCRIPTION 4245c485d1SjtcIf invoked with no arguments, the 4345c485d1Sjtc.Nm wait 4445c485d1Sjtcutility waits until 4545c485d1Sjtcall existing child processes in the background 4645c485d1Sjtchave terminated. 4745c485d1Sjtc.Pp 4845c485d1SjtcAvailable operands: 4945c485d1Sjtc.Bl -tag -width Ds 5045c485d1Sjtc.It Ar pid 5145c485d1SjtcIf a 5245c485d1Sjtc.Ar pid 5345c485d1Sjtcoperand is specified, and it is the process ID of a 5445c485d1Sjtcbackground child process that still exists, the 5545c485d1Sjtc.Nm wait 5645c485d1Sjtcutility 5745c485d1Sjtcwaits until that process has completed and consumes its 5845c485d1Sjtcstatus information, without consuming the status information 5945c485d1Sjtcof any other process. 6045c485d1Sjtc.Pp 6145c485d1SjtcIf a pid operand is specified that is not the process ID of 6245c485d1Sjtca child background process that still exists, 6345c485d1Sjtc.Nm wait 6445c485d1Sjtcexits 6545c485d1Sjtcwithout waiting for any processes to complete. 6645c485d1Sjtc.El 6745c485d1Sjtc.Pp 6845c485d1SjtcThe 6945c485d1Sjtc.Nm wait 7045c485d1Sjtcutility exits with one of the following values: 7145c485d1Sjtc.Bl -tag -width Ds 7245c485d1Sjtc.It \&0 7345c485d1SjtcThe 7445c485d1Sjtc.Nm wait 7545c485d1Sjtcutility was invoked with no operands and 7645c485d1Sjtcall of the existing background child processes have 7745c485d1Sjtcterminated, or the process specified by the pid 7845c485d1Sjtcoperand exited normally with 0 as its exit status. 79*01869ca4Swiz.It \&>\&0 8045c485d1SjtcThe specified process did not exist and its exit 8145c485d1Sjtcstatus information was not available, or the specified 8245c485d1Sjtcprocess existed or its exit status information 8345c485d1Sjtcwas available, and it terminated with a non-zero 8445c485d1Sjtcexit status. 8545c485d1Sjtc.El 8645c485d1Sjtc.Pp 8745c485d1SjtcIf the specified process terminated abnormally due 8845c485d1Sjtcto the receipt of a signal, the exit status 8945c485d1Sjtcinformation of 9045c485d1Sjtc.Nm wait 9145c485d1Sjtccontains that termination status as 9245c485d1Sjtcwell. 9345c485d1Sjtc.Sh STANDARDS 9445c485d1SjtcThe 9545c485d1Sjtc.Nm wait 9645c485d1Sjtccommand is expected to be 9745c485d1Sjtc.St -p1003.2 9845c485d1Sjtccompatible. 99