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. |
||
---|---|---|
benchmarks | ||
build-lib/chibi/char-set | ||
contrib | ||
data | ||
doc | ||
examples | ||
include/chibi | ||
js | ||
lib | ||
opt | ||
tests | ||
tools | ||
.gitignore | ||
.hgignore | ||
.travis.yml | ||
appveyor.yml | ||
AUTHORS | ||
bignum.c | ||
chibi-scheme.pc.in | ||
CMakeLists.txt | ||
configure | ||
COPYING | ||
eval.c | ||
fedora.spec | ||
gc.c | ||
gc_heap.c | ||
main.c | ||
Makefile | ||
Makefile.detect | ||
Makefile.libs | ||
mkfile | ||
opcodes.c | ||
plan9.c | ||
README-win32.md | ||
README.libs | ||
README.md | ||
RELEASE | ||
sexp.c | ||
simplify.c | ||
TODO | ||
VERSION | ||
vm.c |
Minimal Scheme Implementation for use as an Extension Language
http://synthcode.com/wiki/chibi-scheme
Chibi-Scheme is a very small library intended for use as an extension and scripting language in C programs. In addition to support for lightweight VM-based threads, each VM itself runs in an isolated heap allowing multiple VMs to run simultaneously in different OS threads.
There are no external dependencies so is relatively easy to drop into any project.
The default repl language contains all bindings from
R7RS small,
available explicitly as the (scheme small)
library. The
language is built in layers, however - see the manual for
instructions on compiling with fewer features or requesting
a smaller language on startup.
Chibi-Scheme is known to work on 32 and 64-bit Linux, FreeBSD, NetBSD, OpenBSD and OS X, Plan 9, Windows (using Cygwin), iOS, Android, ARM and Emscripten. Basic support for native Windows desktop also exists. See README-win32.md for details and build instructions.
To build on most platforms just run make && make test
. This will
provide a shared library libchibi-scheme, as well as a sample
chibi-scheme command-line repl. You can then run
sudo make install
to install the binaries and libraries. You can optionally specify a PREFIX for the installation directory:
make PREFIX=/path/to/install/
sudo make PREFIX=/path/to/install/ install
By default files are installed in /usr/local.
If you want to try out chibi-scheme without installing, be sure to set
LD_LIBRARY_PATH
so it can find the shared libraries.
For more detailed documentation, run make doc
and see the generated
doc/chibi.html.