xref: /csrg-svn/lib/libc/vax/sys/wait3.s (revision 26804)
1/*
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.  The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
7#ifdef SYSLIBC_SCCS
8_sccsid:.asciz	"@(#)wait3.s	5.3 (Berkeley) 03/09/86"
9#endif SYSLIBC_SCCS
10
11/*	@(#)wait3.s	5.3	(Berkeley)	03/09/86	*/
12
13/*
14 * C library -- wait3
15 *
16 * pid = wait3(&status, flags, &rusage);
17 *
18 * pid == -1 if error
19 * status indicates fate of process, if given
20 * flags may indicate process is not to hang or
21 * that untraced stopped children are to be reported.
22 * rusage optionally returns detailed resource usage information
23 */
24#include "SYS.h"
25
26#define	SYS_wait3	SYS_wait
27
28ENTRY(wait3)
29	movl	8(ap),r0	/* make it easy for system to get */
30	movl	12(ap),r1	/* these extra arguments */
31	bispsw	$0xf		/* flags wait3() */
32	chmk	$SYS_wait3
33	bcc 	noerror
34	movl	r0,_errno
35	mnegl	$1,r0
36	ret
37noerror:
38	tstl	4(ap)		/* status desired? */
39	beql	nostatus	/* no */
40	movl	r1,*4(ap)	/* store child's status */
41nostatus:
42	ret
43