Subject: wait4 arrives in 2.11BSD (#127 - 4 of 4) Index: lib/ 2.11BSD Description: The wait4 syscall is not present in 2.11BSD. This means that 'waitpid' is also not present. The CGL_RTP kernel configuration option has not been known to work for years. Not too long ago i was informed that even if the 'rtp' capability were made operable it interacted very badly with the networking code. The 'rtp' option has moved from the deprecated to removed catagory. The quota system was needlessly complicated by emulation the p_quota member of the 4.3BSD proc structure. It is not necessary to have _both_ the p_quota (in 2.11 this was emulated with the parallel pxquota array) and u_quota entities. The p_quota emulation was removed with no ill effect. Repeat-By: Either by examination or by attempting to compile/link a program which uses 'wait4' or 'waitpid'. Fix: Apply the 4 parts (this is part 4) of the update kit, remake the kernel, reboot, and then remake the modified parts of libc.a This part (#4) contains the following files: /usr/src/lib/libc/pdp/sys/wait4.s Small assembly file implementing the wait4(2) trap to the kernel. /usr/src/man/man2/wait.2 A replacement man page for 'wait' (includes 'wait3', 'wait4' and 'waitpid'). This was converted from the "mandoc" (bletch) macro package and while it formats using '-man' may not look exactly like the earlier 'wait.2' when viewed. /usr/src/lib/libc/gen/popen.c /usr/src/lib/libc/gen/system.c /usr/src/lib/libc/gen/wait.c /usr/src/lib/libc/gen/wait3.c /usr/src/lib/libc/gen/waitpid.c The first 4 of these are replacement files. The 5th file is new. All of them use 'wait4' internally. With 'wait4' and the new 'popen' present it is possible to have multiple 'popen' sessions at once in a program! In fact that was one of the test cases used. Cut where indicated and unshar the file. If complaints about overwriting existing files happen then you forgot to run the "patch.rm" script from part #1 which cleans things up. NOTE: you must have the new kernel up and running before placing these functions in libc.a. To add the new functions to libc.a: cd /usr/src/lib/libc/gen make all ar r /lib/libc.a *.o cd profiled ar r /usr/lib/libc_p.a *.o cd .. make clean and cd /usr/src/lib/libc/pdp/sys make all ar r /lib/libc.a *.o cd profiled ar r /usr/lib/libc_p.a *.o cd .. make clean then ranlib /lib/libc.a /usr/lib/libc_p.a POOF! You are now done and have a smaller kernel with the added functionality of 'wait4' and 'waitpid'. ==============================cut here=================================== #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # /usr/src/lib/libc/pdp/sys/wait4.s # /usr/src/man/man2/wait.2 # /usr/src/lib/libc/gen/popen.c # /usr/src/lib/libc/gen/system.c # /usr/src/lib/libc/gen/wait.c # /usr/src/lib/libc/gen/wait3.c # /usr/src/lib/libc/gen/waitpid.c # This archive created: Mon Mar 15 20:14:07 1993 export PATH; PATH=/bin:/usr/bin:$PATH if test -f '/usr/src/lib/libc/pdp/sys/wait4.s' then echo shar: "will not over-write existing file '/usr/src/lib/libc/pdp/sys/wait4.s'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/lib/libc/pdp/sys/wait4.s' X/* X * No Copyright (c). Placed in the public domain 1993. Steven Schultz X * (sms@wlv.iipo.gtegsc.com). X */ X X#ifdef SYSLIBC_SCCS X_sccsid: <@(#)wait4.s 1.0 (GTE) 3/10/93\0> X .even X#endif SYSLIBC_SCCS X X#include "SYS.h" X XSYSCALL(wait4,norm) SHAR_EOF fi if test -f '/usr/src/man/man2/wait.2' then echo shar: "will not over-write existing file '/usr/src/man/man2/wait.2'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/man/man2/wait.2' X.\" Copyright (c) 1980, 1991 Regents of the University of California. X.\" All rights reserved. X.\" X.\" Redistribution and use in source and binary forms, with or without X.\" modification, are permitted provided that the following conditions X.\" are met: X.\" 1. Redistributions of source code must retain the above copyright X.\" notice, this list of conditions and the following disclaimer. X.\" 2. Redistributions in binary form must reproduce the above copyright X.\" notice, this list of conditions and the following disclaimer in the X.\" documentation and/or other materials provided with the distribution. X.\" 3. All advertising materials mentioning features or use of this software X.\" must display the following acknowledgement: X.\" This product includes software developed by the University of X.\" California, Berkeley and its contributors. X.\" 4. Neither the name of the University nor the names of its contributors X.\" may be used to endorse or promote products derived from this software X.\" without specific prior written permission. X.\" X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X.\" SUCH DAMAGE. X.\" X.\" @(#)wait.2 6.5 (Berkeley) 3/10/91 X.\" X.TH WAIT 2 "March 12, 1993" X.UC 4 X.SH NAME Xwait, waitpid, wait4, wait3 \- wait for process terminatation X.SH SYNOPSIS X.ft B X.nf X#include X#include X.PP X.ft B Xpid = wait(status) Xint pid; Xunion wait *status; X.PP X.ft B X#include X#include X.PP X.ft B Xpid = waitpid(wpid, status, options); Xint pid; Xint wpid; Xunion wait *status; Xint options; X.PP X.ft B Xpid = wait3(status, options, rusage); Xint pid; Xunion wait *status; Xint options; Xstruct rusage *rusage; X.PP X.ft B Xpid = wait4(wpid, status, options, rusage); Xint pid; Xint wpid; Xunion wait *status; Xint options; Xstruct rusage *rusage; X.SH DESCRIPTION XThe X.I wait Xfunction suspends execution of its calling process until X.B status Xinformation is available for a terminated child process, Xor a signal is received. XOn return from a successful X.I wait Xcall, Xthe X.B status Xarea contains termination information about the process that exited Xas defined below. X.PP XThe X.I wait4 Xcall provides a more general interface for programs Xthat need to wait for certain child processes, Xthat need resource utilization statistics accummulated by child processes, Xor that require options. XThe other wait functions are implemented using X.I wait4 . X.PP XThe X.B wpid Xparameter specifies the set of child processes for which to wait. XIf X.B wpid Xis -1, the call waits for any child process. XIf X.B wpid Xis 0, Xthe call waits for any child process in the process group of the caller. XIf X.B wpid Xis greater than zero, the call waits for the process with process id X.B wpid . XIf X.B wpid Xis less than -1, the call waits for any process whose process group id Xequals the absolute value of X.B wpid . X.PP XThe X.B status Xparameter is defined below. The X.B options Xparameter contains the bitwise OR of any of the following options. XThe X.B WNOHANG Xoption Xis used to indicate that the call should not block if Xthere are no processes that wish to report status. XIf the X.B WUNTRACED Xoption is set, Xchildren of the current process that are stopped Xdue to a X.B SIGTTIN , SIGTTOU , SIGTSTP , Xor X.B SIGSTOP Xsignal also have Xtheir status reported. X.PP XIf X.B rusage Xis non-zero, a summary of the resources used by the terminated Xprocess and all its Xchildren is returned (this information is currently not available Xfor stopped processes). X.PP XWhen the X.B WNOHANG Xoption is specified and no processes Xwish to report status, X.I wait4 Xreturns a Xprocess id Xof 0. X.PP XThe X.I waitpid Xcall is identical to X.I wait4 Xwith an X.B rusage Xvalue of zero. XThe older X.I wait3 Xcall is the same as X.I wait4 Xwith a X.B wpid Xvalue of -1. X.PP XThe following macros may be used to test the manner of exit of the process. XOne of the first three macros will evaluate to a non-zero (true) value: X.sp X.I WIFEXITED(status) X\- True if the process terminated normally by a call to X.I _exit(2) Xor X.I exit(2) . X.sp X.I WIFSIGNALED(status) X\- True if the process terminated due to receipt of a signal. X.sp X.I WIFSTOPPED(status) X\- True if the process has not terminated, but has stopped and can be restarted. XThis macro can be true only if the wait call specified the X.B WUNTRACED Xoption Xor if the child process is being traced (see X\fIptrace(2)\fP). X.PP XDepending on the values of those macros, the following macros Xproduce the remaining status information about the child process: X.sp X.I WEXITSTATUS(status) X\- If \fIWIFEXITED(status)\fP Xis true, evaluates to the low-order 8 bits Xof the argument passed to \fI_exit(2)\fP Xor \fIexit(2)\fP Xby the child. X.sp X.I WTERMSIG(status) X\- If \fIWIFSIGNALED(status)\fP Xis true, evaluates to the number of the signal Xthat caused the termination of the process. X.sp X.I WCOREDUMP(status) XIf \fIWIFSIGNALED(status)\fP Xis true, evaluates as true if the termination Xof the process was accompanied by the creation of a core file Xcontaining an image of the process when the signal was received. X.sp X.I WSTOPSIG(status)\fP XIf \fIWIFSTOPPED(status)\fP Xis true, evaluates to the number of the signal Xthat caused the process to stop. X.SH NOTES XSee X.I sigvec(2) Xfor a list of termination signals. XA status of 0 indicates normal termination. X.PP XIf a parent process terminates without Xwaiting for all of its child processes to terminate, Xthe remaining child processes are assigned the parent Xprocess 1 ID (the init process ID). X.PP XIf a signal is caught while any of the X.I wait Xcalls is pending, Xthe call may be interrupted or restarted when the signal-catching routine Xreturns, Xdepending on the options in effect for the signal; Xsee \fIintro(2)\fP, XSystem call restart. X.SH RETURN VALUES XIf X.I wait() Xreturns due to a stopped Xor terminated child process, the process ID of the child Xis returned to the calling process. Otherwise, a value of -1 Xis returned and X.I errno Xis set to indicate the error. X.PP XIf X.I wait4(), wait3() or waitpid() Xreturns due to a stopped Xor terminated child process, the process ID of the child Xis returned to the calling process. XIf there are no children not previously awaited, X-1 is returned with X.I errno Xset to X.B [ECHILD]. XOtherwise, if X.B WNOHANG Xis specified and there are Xno stopped or exited children, X0 is returned. XIf an error is detected or a caught signal aborts the call, Xa value of -1 Xis returned and X.I errno Xis set to indicate the error. X.SH ERRORS X.I Wait() Xwill fail and return immediately if: X.TP 15 X[ECHILD] XThe calling process has no existing unwaited-for Xchild processes. X.TP 15 X[EFAULT] XThe \fIstatus\fP or \fIrusage\fP arguments point to an illegal address. X(May not be detected before exit of a child process.) X.TP 15 X[EINTR] XThe call was interrupted by a caught signal, Xor the signal had the X.I SV_INTERRUPT Xflag set. X.SH STANDARDS XThe X.I wait Xand X.I waitpid Xfunctions are defined by POSIX; X.I wait4 Xand X.I wait3 Xare not specified by POSIX. XThe X.I WCOREDUMP Xmacro Xand the ability to restart a pending X.I wait Xcall are extensions to the POSIX interface. X.SH SEE ALSO X.I exit(2) , X.I sigvec(2) X.Sh HISTORY XA X.I wait Xfunction call appeared in Version 6 AT&T UNIX. SHAR_EOF fi if test -f '/usr/src/lib/libc/gen/popen.c' then echo shar: "will not over-write existing file '/usr/src/lib/libc/gen/popen.c'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/lib/libc/gen/popen.c' X/* X * Copyright (c) 1988 The Regents of the University of California. X * All rights reserved. X * X * This code is derived from software written by Ken Arnold and X * published in UNIX Review, Vol. 6, No. 8. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * California, Berkeley and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char sccsid[] = "@(#)popen.c 5.15 (Berkeley) 2/23/91"; X#endif /* LIBC_SCCS and not lint */ X X#include X#include X#include X#include X#include X Xstatic int *pids; Xextern int errno; X XFILE * Xpopen(program, type) X char *program; X register char *type; X{ X register FILE *iop; X int pdes[2], fds, pid; X X if (*type != 'r' && *type != 'w' || type[1]) X return (NULL); X X if (pids == NULL) { X if ((fds = getdtablesize()) <= 0) X return (NULL); X if ((pids = (int *)malloc((u_int)(fds * sizeof(int)))) == NULL) X return (NULL); X bzero((char *)pids, fds * sizeof(int)); X } X if (pipe(pdes) < 0) X return (NULL); X switch (pid = vfork()) { X case -1: /* error */ X (void) close(pdes[0]); X (void) close(pdes[1]); X return (NULL); X /* NOTREACHED */ X case 0: /* child */ X if (*type == 'r') { X if (pdes[1] != fileno(stdout)) { X (void) dup2(pdes[1], fileno(stdout)); X (void) close(pdes[1]); X } X (void) close(pdes[0]); X } else { X if (pdes[0] != fileno(stdin)) { X (void) dup2(pdes[0], fileno(stdin)); X (void) close(pdes[0]); X } X (void) close(pdes[1]); X } X execl("/bin/sh", "sh", "-c", program, NULL); X _exit(127); X /* NOTREACHED */ X } X /* parent; assume fdopen can't fail... */ X if (*type == 'r') { X iop = fdopen(pdes[0], type); X (void) close(pdes[1]); X } else { X iop = fdopen(pdes[1], type); X (void) close(pdes[0]); X } X pids[fileno(iop)] = pid; X return (iop); X} X Xint Xpclose(iop) X FILE *iop; X{ X register int fdes; X long omask; X union wait pstat; X register int pid; X X /* X * pclose returns -1 if stream is not associated with a X * `popened' command, if already `pclosed', or waitpid X * returns an error. X */ X if (pids == NULL || pids[fdes = fileno(iop)] == 0) X return (-1); X (void) fclose(iop); X omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); X do { X pid = waitpid(pids[fdes], (int *) &pstat, 0); X } while (pid == -1 && errno == EINTR); X (void) sigsetmask(omask); X pids[fdes] = 0; X return (pid == -1 ? -1 : pstat.w_status); X} SHAR_EOF fi if test -f '/usr/src/lib/libc/gen/system.c' then echo shar: "will not over-write existing file '/usr/src/lib/libc/gen/system.c'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/lib/libc/gen/system.c' X/* X * Copyright (c) 1988 The Regents of the University of California. X * All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * California, Berkeley and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char sccsid[] = "@(#)system.c 5.10 (Berkeley) 2/23/91"; X#endif /* LIBC_SCCS and not lint */ X X#include X#include X#include X#include X Xsystem(command) X char *command; X{ X union wait pstat; X register int pid; X long omask; X int (*intsave)(), (*quitsave)(); X X if (!command) /* just checking... */ X return(1); X X omask = sigblock(sigmask(SIGCHLD)); X switch(pid = vfork()) { X case -1: /* error */ X (void)sigsetmask(omask); X pstat.w_status = 0; X pstat.w_retcode = 127; X return(pstat.w_status); X case 0: /* child */ X (void)sigsetmask(omask); X execl("/bin/sh", "sh", "-c", command, (char *)NULL); X _exit(127); X } X intsave = signal(SIGINT, SIG_IGN); X quitsave = signal(SIGQUIT, SIG_IGN); X pid = waitpid(pid, (int *)&pstat, 0); X (void)sigsetmask(omask); X (void)signal(SIGINT, intsave); X (void)signal(SIGQUIT, quitsave); X return(pid == -1 ? -1 : pstat.w_status); X} SHAR_EOF fi if test -f '/usr/src/lib/libc/gen/wait.c' then echo shar: "will not over-write existing file '/usr/src/lib/libc/gen/wait.c'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/lib/libc/gen/wait.c' X/* X * Copyright (c) 1988 The Regents of the University of California. X * All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * California, Berkeley and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char sccsid[] = "@(#)wait.c 5.4 (Berkeley) 2/23/91"; X#endif /* LIBC_SCCS and not lint */ X X#include X#include X#include X#include X Xint Xwait(istat) X int *istat; X{ X return (wait4(WAIT_ANY, istat, 0, (struct rusage *)0)); X} SHAR_EOF fi if test -f '/usr/src/lib/libc/gen/wait3.c' then echo shar: "will not over-write existing file '/usr/src/lib/libc/gen/wait3.c'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/lib/libc/gen/wait3.c' X/* X * Copyright (c) 1988 The Regents of the University of California. X * All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * California, Berkeley and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char sccsid[] = "@(#)wait3.c 5.6 (Berkeley) 2/23/91"; X#endif /* LIBC_SCCS and not lint */ X X#include X#include X#include X#include X Xint Xwait3(istat, options, rup) X int *istat; X int options; X struct rusage *rup; X{ X return (wait4(WAIT_ANY, istat, options, rup)); X} SHAR_EOF fi if test -f '/usr/src/lib/libc/gen/waitpid.c' then echo shar: "will not over-write existing file '/usr/src/lib/libc/gen/waitpid.c'" else sed 's/^X//' << \SHAR_EOF > '/usr/src/lib/libc/gen/waitpid.c' X/* X * Copyright (c) 1988 The Regents of the University of California. X * All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. All advertising materials mentioning features or use of this software X * must display the following acknowledgement: X * This product includes software developed by the University of X * California, Berkeley and its contributors. X * 4. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char sccsid[] = "@(#)waitpid.c 5.4 (Berkeley) 2/23/91"; X#endif /* LIBC_SCCS and not lint */ X X#include X#include X#include X#include X Xint Xwaitpid(pid, istat, options) X int pid; X int *istat; X int options; X{ X return (wait4(pid, istat, options, (struct rusage *)0)); X} SHAR_EOF fi exit 0 # End of shell archive