121902Sdist/* 221902Sdist * Copyright (c) 1983 Regents of the University of California. 3*34391Sbostic * All rights reserved. 4*34391Sbostic * 5*34391Sbostic * Redistribution and use in source and binary forms are permitted 6*34391Sbostic * provided that this notice is preserved and that due credit is given 7*34391Sbostic * to the University of California at Berkeley. The name of the University 8*34391Sbostic * may not be used to endorse or promote products derived from this 9*34391Sbostic * software without specific written prior permission. This software 10*34391Sbostic * is provided ``as is'' without express or implied warranty. 1121902Sdist */ 129987Ssam 13*34391Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint) 14*34391Sbostic_sccsid:.asciz "@(#)wait3.s 5.4 (Berkeley) 05/20/88" 15*34391Sbostic#endif /* SYSLIBC_SCCS and not lint */ 1621902Sdist 17*34391Sbostic/* @(#)wait3.s 5.4 (Berkeley) 05/20/88 */ 1821902Sdist 199987Ssam/* 209987Ssam * C library -- wait3 219987Ssam * 229987Ssam * pid = wait3(&status, flags, &rusage); 239987Ssam * 249987Ssam * pid == -1 if error 259987Ssam * status indicates fate of process, if given 269987Ssam * flags may indicate process is not to hang or 279987Ssam * that untraced stopped children are to be reported. 289987Ssam * rusage optionally returns detailed resource usage information 299987Ssam */ 309987Ssam#include "SYS.h" 319987Ssam 329987Ssam#define SYS_wait3 SYS_wait 339987Ssam 349988SsamENTRY(wait3) 359987Ssam movl 8(ap),r0 /* make it easy for system to get */ 369987Ssam movl 12(ap),r1 /* these extra arguments */ 379987Ssam bispsw $0xf /* flags wait3() */ 389987Ssam chmk $SYS_wait3 399987Ssam bcc noerror 409987Ssam movl r0,_errno 419987Ssam mnegl $1,r0 429987Ssam ret 439987Ssamnoerror: 449987Ssam tstl 4(ap) /* status desired? */ 459987Ssam beql nostatus /* no */ 469987Ssam movl r1,*4(ap) /* store child's status */ 479987Ssamnostatus: 489987Ssam ret 49