waitpid.c revision 55837
1250199Sgrehan/*
2298446Ssephe * Copyright (c) 1988, 1993
3250199Sgrehan *	The Regents of the University of California.  All rights reserved.
4250199Sgrehan *
5250199Sgrehan * Redistribution and use in source and binary forms, with or without
6250199Sgrehan * modification, are permitted provided that the following conditions
7250199Sgrehan * are met:
8250199Sgrehan * 1. Redistributions of source code must retain the above copyright
9250199Sgrehan *    notice, this list of conditions and the following disclaimer.
10250199Sgrehan * 2. Redistributions in binary form must reproduce the above copyright
11250199Sgrehan *    notice, this list of conditions and the following disclaimer in the
12250199Sgrehan *    documentation and/or other materials provided with the distribution.
13250199Sgrehan * 3. All advertising materials mentioning features or use of this software
14250199Sgrehan *    must display the following acknowledgement:
15250199Sgrehan *	This product includes software developed by the University of
16250199Sgrehan *	California, Berkeley and its contributors.
17250199Sgrehan * 4. Neither the name of the University nor the names of its contributors
18250199Sgrehan *    may be used to endorse or promote products derived from this software
19250199Sgrehan *    without specific prior written permission.
20250199Sgrehan *
21250199Sgrehan * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22250199Sgrehan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23250199Sgrehan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24250199Sgrehan * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25250199Sgrehan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26250199Sgrehan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27250199Sgrehan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28250199Sgrehan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29256276Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30256276Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31256276Sdim * SUCH DAMAGE.
32250199Sgrehan *
33296028Ssephe * $FreeBSD: head/lib/libc/gen/waitpid.c 55837 2000-01-12 09:23:48Z jasone $
34250199Sgrehan */
35250199Sgrehan
36250199Sgrehan#if defined(LIBC_SCCS) && !defined(lint)
37250199Sgrehanstatic char sccsid[] = "@(#)waitpid.c	8.1 (Berkeley) 6/4/93";
38250199Sgrehan#endif /* LIBC_SCCS and not lint */
39296181Ssephe
40301588Ssephe#include <sys/types.h>
41301588Ssephe#include <sys/time.h>
42250199Sgrehan#include <sys/wait.h>
43301588Ssephe#include <sys/resource.h>
44250199Sgrehan
45250199Sgrehanpid_t
46250199Sgrehan#if __STDC__
47250199Sgrehan__waitpid(pid_t pid, int *istat, int options)
48302872Ssephe#else
49302619Ssephe__waitpid(pid, istat, options)
50301588Ssephe	pid_t pid;
51300102Ssephe	int *istat;
52307463Ssephe	int options;
53307463Ssephe#endif
54250199Sgrehan{
55302692Ssephe	return (wait4(pid, istat, options, (struct rusage *)0));
56307461Ssephe}
57302864Ssephe
58302713Ssephe__weak_reference(__waitpid, _libc_waitpid);
59302713Ssephe__weak_reference(_libc_waitpid, waitpid);
60302864Ssephe