boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

44-shell-run.scm (391B)


      1 ; Verify the shell.scm prelude's sys-wait + decode-wait-status: clone a
      2 ; child that exits 19, and have the parent decode the wait status.
      3 (define r (sys-clone))
      4 (if (not (car r))
      5     (sys-exit 1)
      6     (if (zero? (cdr r))
      7         (sys-exit 19)
      8         (let ((wr (sys-wait (cdr r))))
      9           (if (car wr)
     10               (sys-exit (decode-wait-status (cdr wr)))
     11               (sys-exit 2)))))