1/* @(#)wait3.s 4.2 (Berkeley) 12/28/82 */ 2 3/* 4 * C library -- wait3 5 * 6 * pid = wait3(&status, flags, &rusage); 7 * 8 * pid == -1 if error 9 * status indicates fate of process, if given 10 * flags may indicate process is not to hang or 11 * that untraced stopped children are to be reported. 12 * rusage optionally returns detailed resource usage information 13 */ 14#include "SYS.h" 15 16#define SYS_wait3 SYS_wait 17 18ENTRY(wait3) 19 movl 8(ap),r0 /* make it easy for system to get */ 20 movl 12(ap),r1 /* these extra arguments */ 21 bispsw $0xf /* flags wait3() */ 22 chmk $SYS_wait3 23 bcc noerror 24 movl r0,_errno 25 mnegl $1,r0 26 ret 27noerror: 28 tstl 4(ap) /* status desired? */ 29 beql nostatus /* no */ 30 movl r1,*4(ap) /* store child's status */ 31nostatus: 32 ret 33