bug-cfengine
[Top][All Lists]
Advanced

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

Re: Signal names with autoconf?


From: David Masterson
Subject: Re: Signal names with autoconf?
Date: 23 Apr 2002 08:32:23 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

>>>>> Mark Burgess writes:

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

Stringize it?

#define STRINGIT(x) #x
strcpy(signame, STRINGIT(SIGKILL));
strcpy(signum, SIGKILL);

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

Getting the list is more difficult.  I don't see anything that
maintains a list of available signals (since CFEngine potentially
supports non-POSIX machines, does this need to go beyond POSIX?).

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

Do you need the ones that are special?  Some of them (like the
real-time signals) don't have names.

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

-- 
David Masterson                David DOT Masterson AT synopsys DOT com
Sr. R&D Engineer               Synopsys, Inc.
Software Engineering           Sunnyvale, CA



reply via email to

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