V7M/src/libc/sys/fork.s

Compare this file to the similar file:
Show the results in this format:

/ C library -- fork

/ pid = fork();
/
/ pid == 0 in child process; pid == -1 means error return
/ in child, parents id is in par_uid if needed

.globl	_fork, _par_uid
.globl	cerror
.fork = 2.

_fork:
	mov	r5,-(sp)
	mov	sp,r5
	sys	.fork
		br 1f
	bec	2f
	jmp	cerror
1:
	mov	r0,_par_uid
	clr	r0
2:
	mov	(sp)+,r5
	rts	pc
.bss
_par_uid: .=.+2