wait.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
2187N/A * The contents of this file are subject to the terms of the 2187N/A * Common Development and Distribution License, Version 1.0 only 2187N/A * (the "License"). You may not use this file except in compliance 2187N/A * See the License for the specific language governing permissions 2187N/A * and limitations under the License. 2187N/A * When distributing Covered Code, include this CDDL HEADER in each 2187N/A * If applicable, add the following below this CDDL HEADER, with the 2187N/A * fields enclosed by brackets "[]" replaced with your own identifying 2187N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2187N/A * Copyright 1995 Sun Microsystems, Inc. All rights reserved. 2187N/A * Use is subject to license terms. 2187N/A/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 2187N/A * Portions of this source code were derived from Berkeley 4.3 BSD 2187N/A * under license from the Regents of the University of California. 2187N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2520N/A * Compatibility lib for BSD's wait3() and wait4(). 2187N/A * Since sysV does not support rusage as in BSD, an approximate approach 2658N/A * rusage ~= diff in the 2 times call 2187N/A * arguments to wait functions from SVR4 2520N/A * SIGCLD signal codes from SVr4 2754N/A * BSD's wait* routines only support WNOHANG & WUNTRACED 2625N/A * It would be -so- nice just to call _wait3 and mapstatus here. 2658N/A * It would be -so- nice just to call _wait4 and mapstatus here. 2658N/A return (-
1);
/* errno is set by times() */ 2658N/A * BSD's wait* routines only support WNOHANG & WUNTRACED 2520N/A * Emulate undocumented 4.x semantics for 1186845 2658N/A return (0);
/* no child found */ 2658N/A return (-
1);
/* errno already set by times() */ 2658N/A return (-
1);
/* error number is set by waitid() */ 2658N/A * Convert the status code to old style wait status