/*
 * 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1986
 * LICENSED MATERIALS - PROPERTY OF IBM
 * REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
 */
 # $Header:wait3.c 12.0$
 # $ACIS:wait3.c 12.0$
 # $Source: /ibm/acis/usr/src/lib/libc/ca/sys/RCS/wait3.c,v $
#include "SYS.h"
	.set	scr15,15
SYSCODE(wait3) 
	mr	r5,r2
	get	r0,$ICSCS_HOKEY	/* Set condition code to indicate wait3 */
	mts	%scr15,r0	/* why not use another system call ? */
	SVC(wait)
	btb	syserror
	cis	r5,0
	ber	r15
	brx	r15
	sts	r0,0(r5)

syserror:
	get	r5,$_errno
	sts	r2,0(r5)	#update error number
	get	r2,$-1
	br	r15	#return to caller
	TTNOFRM
