chibi-scheme/lib/chibi
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
..
char-set add 0085 (NEXT LINE) to char-set:whitespace (fixes #515 2019-02-10 22:36:23 +08:00
crypto replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
io fixing read-line on network ports 2019-05-04 13:18:27 +08:00
iset adding (srfi 14) 2017-08-26 20:34:56 +09:00
loop Removing uneeded \scheme inside \macro in loop docs. 2015-04-28 08:30:12 +09:00
match match should treat keywords as literals, not identifiers, in Chicken 2016-10-05 23:13:29 +09:00
math replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
monad initial (chibi show column) impl 2017-06-17 21:53:35 +09:00
net clarifying default config params for http-server 2019-01-06 08:45:48 +08:00
optimize Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
parse fix order of arguments to parse-fold 2018-12-11 12:46:42 +01:00
regexp replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
show fixing bug in pp-with-indent on dotted list 2019-08-24 16:00:47 +08:00
snow update-repository shouldn't exit 2019-01-11 08:48:45 +08:00
term adding true color ansi support 2019-03-13 23:57:22 +08:00
win32 fixing test-build 2018-01-25 01:07:49 +09:00
accept.c Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
app-test.sld Allowing option parsing to fallback to top-level options from within subcommands. 2015-06-05 22:46:45 +09:00
app.scm removing duplicate revomal of program-name in (chibi app) 2018-12-28 23:48:13 +08:00
app.sld Adding (chibi app) docs. 2015-04-30 17:21:36 +09:00
ast.c adding port-source?[-set!] to ast 2019-08-15 23:18:07 +08:00
ast.scm adding -Dsafe-string-cursors feature to perform extra checks on string cursors 2019-02-01 00:31:13 +08:00
ast.sld adding port-source?[-set!] to ast 2019-08-15 23:18:07 +08:00
base64-test.sld various portability improvements 2017-03-26 16:00:31 +09:00
base64.scm adding (srfi 142), using that in place of (srfi 33) 2017-04-16 22:06:56 +09:00
base64.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
binary-record-chicken.scm provide a nicer binary type interface 2017-03-25 17:46:30 +09:00
binary-record.scm provide a nicer binary type interface 2017-03-25 17:46:30 +09:00
binary-record.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
binary-types.scm adding missing file 2017-04-06 13:47:57 +09:00
bytevector-test.sld supporting ber encoding in bytevectors 2018-12-09 03:44:19 +08:00
bytevector.scm supporting ber encoding in bytevectors 2018-12-09 03:44:19 +08:00
bytevector.sld supporting ber encoding in bytevectors 2018-12-09 03:44:19 +08:00
channel.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
channel.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
char-set.sld More documentation improvements. 2015-05-01 07:55:25 +09:00
config.scm also print error 2019-01-06 08:22:43 +08:00
config.sld also print error 2019-01-06 08:22:43 +08:00
disasm.c (chibi disasm): Use %I64d on Win64 2017-12-13 22:00:13 +09:00
disasm.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
doc-test.sld Recognizing named-let in get-optionals-signature. 2015-05-02 21:47:04 +09:00
doc.scm fixing docs for chibi ffi 2017-04-03 23:23:07 +09:00
doc.sld Fixing extract-module-file-docs for a library outside the search path. 2015-05-10 20:45:01 +09:00
emscripten.scm Adding missing emscripten files. 2015-02-25 07:43:35 +09:00
emscripten.sld Adding missing emscripten files. 2015-02-25 07:43:35 +09:00
emscripten.stub Adding missing emscripten files. 2015-02-25 07:43:35 +09:00
equiv.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
equiv.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
filesystem-test.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
filesystem.scm (chibi filesystem): Stub out several features on Win32 2017-12-31 07:32:22 +09:00
filesystem.sld port (chibi filesystem) to chicken 2017-02-13 22:43:08 +09:00
filesystem.stub (chibi filesystem) Win32: A bit more shims 2017-12-13 22:00:07 +09:00
filesystem_win32_shim.c (chibi filesystem) Win32: A bit more shims 2017-12-13 22:00:07 +09:00
generic-test.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
generic.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
generic.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
heap-stats.c Added full support for packed images, both for static and dynamic libraries. 2016-02-15 21:12:58 -05:00
heap-stats.sld adding free-sizes complement to heap-sizes 2015-06-15 21:34:25 +09:00
highlight.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
highlight.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
ieee-754.scm supporting non-native endianness and non-finite floating values 2018-12-06 23:25:18 +08:00
io-test.sld fixing bug in flushed output on custom ports 2018-06-23 19:21:38 +08:00
io.sld moving make-generated-binary-input-port to (chibi io) 2017-06-29 14:17:58 +09:00
iset-test.sld more intersection/difference tests 2016-05-18 23:17:26 +09:00
iset.sld sort libs within a package before installing, 2017-01-30 22:48:02 +09:00
json-test.sld adding wip json parser 2019-08-23 00:45:58 +08:00
json.c adding wip json parser 2019-08-23 00:45:58 +08:00
json.sld adding wip json parser 2019-08-23 00:45:58 +08:00
log-test.sld adding (chibi log) tests 2018-01-11 22:42:18 +09:00
log.scm adding (chibi log) tests 2018-01-11 22:42:18 +09:00
log.sld adding (chibi log) tests 2018-01-11 22:42:18 +09:00
loop-test.sld making string-cursors a disjoint type 2016-03-29 22:25:09 +09:00
loop.sld Adding for loop shortcut syntax. 2015-04-24 21:27:35 +09:00
match-test.sld fixing named match-let 2016-03-06 22:54:28 +09:00
match.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
memoize-test.sld portability changes 2016-09-26 23:10:09 +09:00
memoize.scm bring memoize-to-file up-to-date with string-cursor api 2017-05-30 15:35:57 +09:00
memoize.sld portability changes 2016-09-26 23:10:09 +09:00
mime-test.sld various portability improvements 2017-03-26 16:00:31 +09:00
mime.scm various portability improvements 2017-03-26 16:00:31 +09:00
mime.sld various portability improvements 2017-03-26 16:00:31 +09:00
modules.scm adding port-source?[-set!] to ast 2019-08-15 23:18:07 +08:00
modules.sld Fixing snow doc extraction for multiple levels of includes. 2017-01-19 23:58:09 +09:00
net.scm open-net-io should ior flags w/ non-block, not and them 2015-08-28 23:37:37 +09:00
net.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
net.stub Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
numeric-test.sld fix comparison of negative bignums (issue #541) 2019-05-21 22:26:37 +08:00
optimize.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
optimize.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
optional-test.sld allowing required args in opt-lambda, adding define-opt 2019-08-24 22:34:20 +08:00
optional.scm allowing required args in opt-lambda, adding define-opt 2019-08-24 22:34:20 +08:00
optional.sld allowing required args in opt-lambda, adding define-opt 2019-08-24 22:34:20 +08:00
parse-test.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
parse.sld Fleshing out (chibi parse) docs and adding to the manual. 2015-05-02 21:47:24 +09:00
pathname-test.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
pathname.scm adding -Dsafe-string-cursors feature to perform extra checks on string cursors 2019-02-01 00:31:13 +08:00
pathname.sld Fixing description of pathname library. 2015-05-03 08:12:46 +09:00
process-test.sld (chibi process): fix process-running? on OpenBSD, NetBSD and DragonFly 2019-08-30 13:05:32 -05:00
process.scm exit codes should be exact (issue #467) 2018-04-05 22:11:05 +09:00
process.sld Fix include-shared for process 2019-07-24 11:10:04 +00:00
process.stub removing redundant renaming to same name execvp 2017-08-28 23:41:34 +09:00
pty-test.sld adding (chibi pty) 2019-08-19 23:03:09 +08:00
pty.sld adding (chibi pty) 2019-08-19 23:03:09 +08:00
pty.stub (chibi pty): fix compilation errors on the BSDs 2019-08-22 16:33:10 -05:00
quoted-printable-test.sld various portability improvements 2017-03-26 16:00:31 +09:00
quoted-printable.scm various portability improvements 2017-03-26 16:00:31 +09:00
quoted-printable.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
regexp-test.sld allow zero-or-more (*) combining characters in the 'grapheme SRE rather than one-or-more (+) 2018-09-18 23:21:27 +08:00
regexp.scm More error checking on some SRE syntax 2019-07-21 10:46:44 +07:00
regexp.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
reload.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
reload.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
repl.scm fix string-mismatch usage in (chibi repl) 2019-08-16 23:39:36 +08:00
repl.sld more helpful error messages on missing libraries 2019-04-21 22:11:11 +08:00
scribble-test.sld various portability improvements 2017-03-26 16:00:31 +09:00
scribble.scm Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
scribble.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
show-test.sld fixing edge cases 2019-03-12 00:37:00 +08:00
show.sld allowing strings for decimal-sep; s/fn-fork/forked/g 2019-02-27 23:59:10 +08:00
signal.c (chibi process): fix process-running? on OpenBSD, NetBSD and DragonFly 2019-08-30 13:05:32 -05:00
string-test.sld various portability improvements 2017-03-26 16:00:31 +09:00
string.scm adding -Dsafe-string-cursors feature to perform extra checks on string cursors 2019-02-01 00:31:13 +08:00
string.sld various portability improvements 2017-03-26 16:00:31 +09:00
stty.scm removing duplicate definition of ixon (issue #402) 2017-04-10 22:19:40 +09:00
stty.sld adding (chibi pty) 2019-08-19 23:03:09 +08:00
stty.stub adding (chibi pty) 2019-08-19 23:03:09 +08:00
sxml.scm More documentation improvements. 2015-05-01 07:55:25 +09:00
sxml.sld More documentation improvements. 2015-05-01 07:55:25 +09:00
syntax-case-test.sld Implement with-ellipsis 2018-12-09 19:05:22 +01:00
syntax-case.scm Implement with-ellipsis 2018-12-09 19:05:22 +01:00
syntax-case.sld typo, export ellipsis-identifier? 2018-12-28 23:40:26 +08:00
system-test.sld move definitions to start of body 2016-02-28 18:05:02 +09:00
system.sld Update system.sld 2016-04-09 16:13:43 +02:00
system.stub Emscripten support by default. Patch from Marc Nieper-Wi?kirchen. 2015-02-22 16:10:30 +09:00
tar-test.sld removing own username from tar tests 2017-03-25 19:44:36 +09:00
tar.scm -R needs interpreter name, not SRFI 22 2019-01-01 23:18:49 +08:00
tar.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
temp-file.scm Adding a preserve thunk to call-with-temp-file/dir. 2015-04-24 22:52:13 +09:00
temp-file.sld replacing (srfi 142) with (srfi 151) 2017-08-21 22:32:57 +09:00
test.scm tests which expect an inexact value can accept an equivalent exact value 2018-03-17 16:50:41 +09:00
test.sld various portability improvements 2017-03-26 16:00:31 +09:00
time.sld build on Solaris-like systems 2019-08-11 22:30:17 +00:00
time.stub build on Solaris-like systems 2019-08-11 22:30:17 +00:00
trace.scm Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
trace.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
type-inference.scm fixing bug in type inference 2015-12-23 17:26:51 +09:00
type-inference.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
uri-test.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
uri.scm additional string-cursor fixes for snow 2016-05-19 23:38:13 +09:00
uri.sld Making libraries portable where possible. 2015-04-26 16:17:38 +09:00
weak-test.sld Fixing weak references. 2015-06-20 23:03:44 +09:00
weak.c (chibi weak) library is a noop when not compiling with weak references. 2015-06-14 15:27:21 +09:00
weak.sld Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
zlib.scm Adding a preserve thunk to call-with-temp-file/dir. 2015-04-24 22:52:13 +09:00
zlib.sld porting (chibi temp-file) and (chibi zlib) to chicken 2017-03-25 18:26:35 +09:00