/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* All of the wait*() functions are cancellation points.
*/
#include "lint.h"
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <wait.h>
#include <sys/resource.h>
/*
* Convert the siginfo_t code and status fields to an old style wait status.
*/
static int
{
switch (code) {
case CLD_EXITED:
stat <<= 8;
break;
case CLD_DUMPED:
break;
case CLD_KILLED:
break;
case CLD_TRAPPED:
case CLD_STOPPED:
stat <<= 8;
break;
case CLD_CONTINUED:
break;
}
return (stat);
}
{
int error;
if (pid > 0) {
} else if (pid < -1) {
} else if (pid == -1) {
id = 0;
} else {
}
return (error);
if (stat_loc)
}
{
}
{
int error;
int noptions;
if (rp)
return (-1); /* errno is set by times() */
/*
* SunOS's wait4() previously supported only WNOHANG &
* WUNTRACED. XPG4v2 mandates that wait3() (which calls
* wait4()) also support WCONTINUED.
*/
return (-1);
}
/*
* Emulate undocumented 4.x semantics for 1186845
*/
if (pid < 0) {
} else if (pid == 0) {
} else {
}
if (error == 0) {
return (0); /* no child found */
if (rp) {
return (-1); /* errno set by times() */
/*
*/
}
if (stat_loc)
} else {
return (-1); /* error number is set by waitid() */
}
}
{
}