bug-cfengine
[Top][All Lists]
Advanced

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

Re: Signal names with autoconf?


From: Tim Auckland
Subject: Re: Signal names with autoconf?
Date: Tue, 23 Apr 2002 08:44:54 -0700

Bash does it this way.  It just #includes <signal.h> then goes through a
long list of expected signal names and uses those that it finds have
been #defined.  I'm sure it wouldn't be hard to come up with a list that
will cover 90% of your supported platforms and still be a lot better
than the current approach.

Tim



address@hidden wrote:
> 
> > Why do you need a table? Ok, I admit, I have not looked at the code for
> > the signal stuff, *yet*. but if you need a table, you can just use the
> > symbolic name and the #define'd value. "hup" and SIGHUP for example.
> >
> > Instead of telling me this is nonsense, correct me. or give me a good
> > reason to shut up ;)
> >
> > Mike.
> 
> The information in the header file does not constitute a variable.
> 
> #define SIGKILL 9
> 
> replaces the string SIGKILL in any source code with the number 9.
> Nothing remains of the name SIGKILL. Only the number 9 can be
> obtained from the header file. That means that the name of the signal
> in this included file is completely lost to the program.
> 
> In order to recognise the strong "sigkill" in cfengine and match it
> to a number, we have to associate that name with the correct number.
> That means we need to obtain the list.
> 
> Now, we can get part way using your idea by making a free list
> association in some variables:
> 
> SIGS[sigkill] = SIGKILL
> SIGS[sigint] = SIGINT
> 
> etc. But we can no longer make a table, since
> problem here is that we don't know all of the names
> that are defined as signals on the different platforms. There's
> a few names which are standard, but also several special ones
> which make this difficult.
> 
> Perhaps we don't need all of the names in cfengine. I don't
> know what people will want to do. Users can just use the signal
> number if they want to anyway... One could return an error:
> 
>  "cfengine does not recognize this signal name, please use a number"
> 
> perhaps to get around this. THe simplest solution is to only
> support the most common names that are found on every unix.
> 
> M
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  address@hidden
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> _______________________________________________
> Bug-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-cfengine



reply via email to

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