Need signal generator

Peter Samuelson peter at cadcamlab.org
Fri May 5 21:30:06 GMT 2000


[Ron Alexander <rcalex at home.com>]
> The OS I am porting Samba to does not have a kill cmd or any method
> to generate SIGUSR1, SIGUSR2 etc.
[...]
> Can someone point me to some source code that will allow me to send a
> signal to a process.

The source is quite simple -- kill(2) is a simple wrapper around a
system call.

If VOS has the necessary system calls, you should be able to write
simple wrapper functions around them, and a simple wrapper main()
function around *those*, to get a `kill' command.

If VOS does not have any such system calls, i.e. it does not have the
concept of a signal, there isn't a whole lot you can do other than add
it in at the OS level.  Certainly, existing source code for Unix user
space will be useless except as an example of what the nonexistent
interface *should* do.

You *may* be able to emulate signals using thread sync primitives, if
you have threading.  You would set up a "signal agent" thread that
would listen on an IPC channel of some sort which represents that
process's signals.  Then it would suspend the other running thread --
however that might be accomplished using your threading model -- and
run the signal handler installed by your replacement for signal() or
whatever.  When the signal handler finishes, it would restart its
sibling thread (assuming the handler didn't kill it already, like the
default handlers for most of the signals should do).

That's the only way I can think of.  And it wouldn't be pretty, if
indeed possible.  (I also don't really know what I'm talking about.  I
do not know threads very well.)

Peter


More information about the samba-technical mailing list