boot2

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

commit 7e6e49004c67be0c88cce368096d626450ec804a
parent 72181739d2d6abfa06af1b8e456ac86d3907fd1e
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Tue,  5 May 2026 12:03:38 -0700

scheme1/prelude: drop redundant errno negate in sys-spawn probe

wrap_syscall_result already converts the kernel's -errno into a
positive errno in cdr; the probe was negating it a second time, so
the comparison against ENOSYS=38 only worked by accident on Linux
(where -38 != 38) and broke when the kernel started returning the
positive form consistently.

Diffstat:
Mscheme1/prelude.scm | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/scheme1/prelude.scm b/scheme1/prelude.scm @@ -530,16 +530,15 @@ ;; - sys-clone + sys-execve: classic POSIX fork+exec. Provided by Linux; ;; not implemented by the seed kernel. ;; Probe once at prelude-init time. The probe call uses an empty path, -;; so on the seed kernel it returns (#f . -ENOENT) (the kernel finds the +;; so on the seed kernel it returns (#f . ENOENT) (the kernel finds the ;; argv/path checks before any side effect); on Linux it returns -;; (#f . -ENOSYS). We treat anything other than -ENOSYS as "available". +;; (#f . ENOSYS). wrap_syscall_result already negates kernel -errno into +;; positive errno in cdr; treat anything other than ENOSYS as "available". (define %has-sys-spawn? (let ((r (sys-spawn "" '()))) (cond ((car r) #t) - (else - (let ((errno (- 0 (cdr r)))) - (not (= errno 38))))))) + (else (not (= (cdr r) 38)))))) (define (spawn prog . args) (cond