chibi-scheme/lib
Kris Katterjohn 3da3f3cab3 (chibi process): fix process-running? on OpenBSD, NetBSD and DragonFly
tl;dr process-running? would always return #f on OpenBSD and
NetBSD, and in the one-argument case it would always return #t
on DragonFly.

To get the process information from the process table on OpenBSD
and NetBSD, we need to pass 6 level names to sysctl instead of 4.
Passing the wrong number of level names to sysctl has caused it
to always fail, which in turn caused process-running? to always
return #f:

  (process-running? 1)                        =>  #f
  (process-running? (current-process-id))     =>  #f

and so on.

After the above fix, we also need to check the amount of data
actually filled in by sysctl.  It appears that on OpenBSD, NetBSD
and DragonFly, if the requested process doesn't exist then sysctl
will return with a return value of 0 and just not actually fill in
the given structure.  This caused process-running? to return #t
when no process with the given PID existed:

  (process-running? -1)                       =>  #t
  (process-running? <other nonexistent pid>)  =>  #t

and so on.

I have tested on OpenBSD, NetBSD, DragonFly BSD and FreeBSD, and
process-running? now behaves as expected on all of them.
2019-08-30 13:05:32 -05:00
..
chibi (chibi process): fix process-running? on OpenBSD, NetBSD and DragonFly 2019-08-30 13:05:32 -05:00
scheme Consider unterminated strings as read-error 2019-05-17 10:55:22 +02:00
srfi removing undocumented upcased and downcased 2019-02-28 00:19:01 +08:00
init-7.scm missing space before quote (issue #545) 2019-07-12 00:04:52 +08:00
meta-7.scm Implement syntax-case 2018-12-01 13:48:25 +01:00