On Mon, 16 Oct 1995, Larry Wall wrote:
> : One thing that you could do is to build a huge list of all the signal
> : names and write a small C program to test what is available, like what
> : is done for the cpp symbols...
>
> You probably want to use as many sources of signal names as you can get
> your hands on, in addition to the "known" signals. A kill -l is likely
> to at least mention any signals not in your list, even if you don't
> know enough about its format to deduce the signal numbers from it.
>
> Then there's strings -3 /bin/kill. Or od -s /bin/kill.
That's pretty twisted, but maybe not as twisted as what I've tried. You
may have to hand edit cppstdin, cppflags, cppminus, and fieldn for your
system, but probably not. Of course, Configure figures them out for you.
This is just a test script.
I've tested this on SunOS 4.1.3. Could folks with other systems check it
out and let me know if it prints a reasonable list of possible symbols. If
this fails, I'll fall back on a big list of signal names.
Then, I'll pass the list of signal names through a script from Raphael to
check which ones are really defined on a particular system with particular
compiler options.
Andy Dougherty doughera@lafcol.lafayette.edu
#!/bin/sh
if test -x /usr/local/bin/cppstdin; then
cppstdin=/usr/local/bin/cppstdin
else
cppstdin='cc -E'
fi
cppminus='-'
cppflags=''
fieldn=3
cat=cat
grep=grep
awk=awk
sed=sed
sort=sort
uniq=uniq
: Generate a list of possible signal names. First, trace out the
: Files included by signal.h, then look for SIGxxx names.
files=` echo '#include <signal.h>' |
$cppstdin $cppminus $cppflags 2>/dev/null |
$grep "^[ ]*#.*include" |
$awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
xxx=`awk '
$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/{
print substr($2, 4, 20)
}
$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ {
print substr($3, 4, 20)
}' $files`
echo $xxx
> : One thing that you could do is to build a huge list of all the signal
> : names and write a small C program to test what is available, like what
> : is done for the cpp symbols...
>
> You probably want to use as many sources of signal names as you can get
> your hands on, in addition to the "known" signals. A kill -l is likely
> to at least mention any signals not in your list, even if you don't
> know enough about its format to deduce the signal numbers from it.
>
> Then there's strings -3 /bin/kill. Or od -s /bin/kill.
That's pretty twisted, but maybe not as twisted as what I've tried. You
may have to hand edit cppstdin, cppflags, cppminus, and fieldn for your
system, but probably not. Of course, Configure figures them out for you.
This is just a test script.
I've tested this on SunOS 4.1.3. Could folks with other systems check it
out and let me know if it prints a reasonable list of possible symbols. If
this fails, I'll fall back on a big list of signal names.
Then, I'll pass the list of signal names through a script from Raphael to
check which ones are really defined on a particular system with particular
compiler options.
Andy Dougherty doughera@lafcol.lafayette.edu
#!/bin/sh
if test -x /usr/local/bin/cppstdin; then
cppstdin=/usr/local/bin/cppstdin
else
cppstdin='cc -E'
fi
cppminus='-'
cppflags=''
fieldn=3
cat=cat
grep=grep
awk=awk
sed=sed
sort=sort
uniq=uniq
: Generate a list of possible signal names. First, trace out the
: Files included by signal.h, then look for SIGxxx names.
files=` echo '#include <signal.h>' |
$cppstdin $cppminus $cppflags 2>/dev/null |
$grep "^[ ]*#.*include" |
$awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
xxx=`awk '
$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/{
print substr($2, 4, 20)
}
$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ {
print substr($3, 4, 20)
}' $files`
echo $xxx