octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variable(s) for signal numbers?


From: Andy Adler
Subject: Re: variable(s) for signal numbers?
Date: Fri, 10 Jan 2003 17:15:32 -0500 (EST)

I think that the second form would be fine.
Everyone who wants to use kill should be
doing "help kill" first anyway.

Additionally, you then would have the semantics to
pull some 'perl'ish tricks and define virtual signals.

I'm refering to $SIG{__WARN__} and $SIG{__DIE__},
which refer to code doing the corresponding things.

Andy


On Fri, 10 Jan 2003, John W. Eaton wrote:

> 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
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]