xref: /csrg-svn/lib/libc/vax/sys/wait3.s (revision 34830)
121902Sdist/*
221902Sdist * Copyright (c) 1983 Regents of the University of California.
334391Sbostic * All rights reserved.
434391Sbostic *
534391Sbostic * Redistribution and use in source and binary forms are permitted
6*34830Sbostic * provided that the above copyright notice and this paragraph are
7*34830Sbostic * duplicated in all such forms and that any documentation,
8*34830Sbostic * advertising materials, and other materials related to such
9*34830Sbostic * distribution and use acknowledge that the software was developed
10*34830Sbostic * by the University of California, Berkeley.  The name of the
11*34830Sbostic * University may not be used to endorse or promote products derived
12*34830Sbostic * from this software without specific prior written permission.
13*34830Sbostic * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*34830Sbostic * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*34830Sbostic * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1621902Sdist */
179987Ssam
1834391Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
19*34830Sbostic	.asciz "@(#)wait3.s	5.5 (Berkeley) 06/27/88"
2034391Sbostic#endif /* SYSLIBC_SCCS and not lint */
2121902Sdist
22*34830Sbostic/*	@(#)wait3.s	5.5	(Berkeley)	06/27/88	*/
2321902Sdist
249987Ssam/*
259987Ssam * C library -- wait3
269987Ssam *
279987Ssam * pid = wait3(&status, flags, &rusage);
289987Ssam *
299987Ssam * pid == -1 if error
309987Ssam * status indicates fate of process, if given
319987Ssam * flags may indicate process is not to hang or
329987Ssam * that untraced stopped children are to be reported.
339987Ssam * rusage optionally returns detailed resource usage information
349987Ssam */
359987Ssam#include "SYS.h"
369987Ssam
379987Ssam#define	SYS_wait3	SYS_wait
389987Ssam
399988SsamENTRY(wait3)
409987Ssam	movl	8(ap),r0	/* make it easy for system to get */
419987Ssam	movl	12(ap),r1	/* these extra arguments */
429987Ssam	bispsw	$0xf		/* flags wait3() */
439987Ssam	chmk	$SYS_wait3
449987Ssam	bcc 	noerror
459987Ssam	movl	r0,_errno
469987Ssam	mnegl	$1,r0
479987Ssam	ret
489987Ssamnoerror:
499987Ssam	tstl	4(ap)		/* status desired? */
509987Ssam	beql	nostatus	/* no */
519987Ssam	movl	r1,*4(ap)	/* store child's status */
529987Ssamnostatus:
539987Ssam	ret
54