home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / libc / sys / wait.s < prev    next >
Encoding:
Text File  |  1979-01-10  |  318 b   |  27 lines

  1. / C library -- wait
  2.  
  3. / pid = wait(0);
  4. /   or,
  5. / pid = wait(&status);
  6. /
  7. / pid == -1 if error
  8. / status indicates fate of process, if given
  9.  
  10. .globl    _wait
  11. .globl    cerror
  12. .wait = 7.
  13.  
  14. _wait:
  15.     mov    r5,-(sp)
  16.     mov    sp,r5
  17.     sys    .wait
  18.     bec    1f
  19.     jmp    cerror
  20. 1:
  21.     tst    4(r5)
  22.     beq    1f
  23.     mov    r1,*4(r5)    / status return
  24. 1:
  25.     mov    (sp)+,r5
  26.     rts    pc
  27.