boot2

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

069-open-input-missing.scm (505B)


      1 ; Pin the (#f . errno) failure branch of open-input. ENOENT is errno 2
      2 ; on Linux; sys-openat returns the negated errno boxed by sys-openat
      3 ; itself. We don't pin the specific value here -- different libcs may
      4 ; return different signs/conventions -- but we do require:
      5 ;   - car is #f (not the success #t)
      6 ;   - cdr is an integer (a real errno-like code, not garbage)
      7 (define r (open-input "/this/path/should/not/exist/scheme1-test"))
      8 (if (and (not (car r)) (integer? (cdr r)))
      9     (exit 0)
     10     (exit 1))