(Full reply quoted below for posterity after a forgotten cc.)
Date: Tue, 25 Oct 2011 20:28:17 -0700
From: Will Noble <***@cow9.org>
I haven't changed the way this is accomplished: when POSIX gets initialized
the C code has knowledge of the value of SIGSTOP from the system headers and
has knowledge of the position of (signal stop) in the vector holding all the
named signals, and it conveys this to the Scheme code. I converted the
_rest_ to Scheme.
OK, that sounds reasonable, as long as you are always careful to make
sure that the OS-dependent numbers are ephemeral and don't make their
way into heap images.
It should really be unnecessary to write most of this code by hand,
but avoiding that nicely is hard and takes a lot more effort than I
have time for these days. With apologies to posterity, I put some
sketches up at <http://mumble.net/~campbell/tmp/stubber-20100507.tgz>,
in a wretched, unpresentable state only because I don't expect to get
back to this in the foreseeable future.
Date: Tue, 25 Oct 2011 20:28:17 -0700
(Did you intend to reply privately, without ccing the list?)
Date: Tue, 25 Oct 2011 17:33:39 -0700
Thanks for the quick respone! Is the issue you mention a problem
even when, as before, symbolic errnos/signals resume correctly
(by name) while numeric ones and PIDs are marked unresumable?
You're doing something wrong if you store a pid in a heap image and
hope it means anything useful when you resume the heap image. But
there's nothing wrong with storing an object representing EXDEV or
SIGSTOP in a heap image and using it meaningfully when the heap image
is resumed, independent of what (POSIX) operating system you resume it
on.
Granted, errno and signal numbers tend to be constant across all
Unices, but there are plenty of similar things that aren't. (E.g.,
getaddrinfo's EAI_* values.)
Hi,
Nope. I forgot to cc and I bounced it to the list after I sent it :)
I did exactly what you say: PIDs refuse to be written to heap images; a
signal obtained by calling (signal stop) or an errno obtained from (errno
xdev) retains its value. On the other hand, the signal (integer->signal
300), like the PID, complains when written out.
I haven't changed the way this is accomplished: when POSIX gets initialized
the C code has knowledge of the value of SIGSTOP from the system headers and
has knowledge of the position of (signal stop) in the vector holding all the
named signals, and it conveys this to the Scheme code. I converted the
_rest_ to Scheme.
Best,
Will