xref: /csrg-svn/lib/libc/vax/sys/wait3.s (revision 21902)
1*21902Sdist/*
2*21902Sdist * Copyright (c) 1983 Regents of the University of California.
3*21902Sdist * All rights reserved.  The Berkeley software License Agreement
4*21902Sdist * specifies the terms and conditions for redistribution.
5*21902Sdist */
69987Ssam
7*21902Sdist#ifndef lint
8*21902Sdiststatic char sccsid[] = "@(#)wait3.s	5.1 (Berkeley) 06/03/85";
9*21902Sdist#endif not lint
10*21902Sdist
11*21902Sdist/*	@(#)wait3.s	5.1	(Berkeley)	06/03/85	*/
12*21902Sdist
139987Ssam/*
149987Ssam * C library -- wait3
159987Ssam *
169987Ssam * pid = wait3(&status, flags, &rusage);
179987Ssam *
189987Ssam * pid == -1 if error
199987Ssam * status indicates fate of process, if given
209987Ssam * flags may indicate process is not to hang or
219987Ssam * that untraced stopped children are to be reported.
229987Ssam * rusage optionally returns detailed resource usage information
239987Ssam */
249987Ssam#include "SYS.h"
259987Ssam
269987Ssam#define	SYS_wait3	SYS_wait
279987Ssam
289988SsamENTRY(wait3)
299987Ssam	movl	8(ap),r0	/* make it easy for system to get */
309987Ssam	movl	12(ap),r1	/* these extra arguments */
319987Ssam	bispsw	$0xf		/* flags wait3() */
329987Ssam	chmk	$SYS_wait3
339987Ssam	bcc 	noerror
349987Ssam	movl	r0,_errno
359987Ssam	mnegl	$1,r0
369987Ssam	ret
379987Ssamnoerror:
389987Ssam	tstl	4(ap)		/* status desired? */
399987Ssam	beql	nostatus	/* no */
409987Ssam	movl	r1,*4(ap)	/* store child's status */
419987Ssamnostatus:
429987Ssam	ret
43