[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
variable(s) for signal numbers?
From: |
John W. Eaton |
Subject: |
variable(s) for signal numbers? |
Date: |
Fri, 10 Jan 2003 13:45:14 -0600 |
I just implemented a kill function for Octave so you can send signals
to other processes (for example, those you started asynchronously with
system, or a fork/exec). Now I see that it would be useful to have a
way to access signals by name instead of number, so that you could
write
kill (pid, SIGHUP);
instead of
kill (pid, 1);
for example. The problem with using names like SIGHUP, SIGINT,
etc. is that it adds a lot of built-in variables. Perhaps it would be
better to have a structure, say __siglist__ (or something, suggestions
for a better name are welcome), that has members like HUP, INT, etc,
so you would write
kill (pid, __siglist__.HUP);
Then we only add one name to the list of built-in variables instead of
many.
OTOH, to someone used to programming Unixy systems, this doesn't look
as familiar as using SIGHUP.
Comments?
Thanks,
jwe
- variable(s) for signal numbers?,
John W. Eaton <=