Re: BUG FIX to procps-based psupdate: ELF-kernel-capable version.

Jeff Uphoff (juphoff@tarsier.cv.nrao.edu)
Fri, 7 Jul 1995 13:48:54 -0400


"JL" == Jim Lynch <jimlynch@netcom.com> writes:

JL> On 6 Jul 1995, Jeff Uphoff wrote:
>> I've also fixed the Makefile-based problem with 'killall' et al. not
>> picking up signals by name due to their having been moved to
>> <asm/signal.h>. Thanks to Clive Messer <clive@epos.demon.co.uk> for
>> pointing this out.

JL> Are you saying that killall reads a .h file??

No. It generates one of its own liking, during compilation, from the
system's signal.h file:

In the (new) Makefile:

# If you have an older kernel, this may need to be /usr/include/linux/signal.h
signalheader=/usr/include/asm/signal.h

[...]

signames.h: $(signalheader)
tr -s '\t ' ' ' <$(signalheader) | sed \
's:#define SIG\([A-Z]\+[0-9]*\) \([0-9]\+\) *\(\|/\*.*\)$$:{ \2,"\1" },:p
;d' \
> signames.h

And the signames.h file that killall (and top and fuser) use to get the
by-name signals winds up looking like:

{ 1,"HUP" },
{ 2,"INT" },

[...]

{ 31,"UNUSED" },

Which is included into the build via the following code (in signals.c):

static SIGNAME signals[] = {
#include "signames.h"
{ 0,NULL }};

It's all pretty straightforward, but easily confused if the file
containing the signal #define's is moved and it's not told about it.
:)~

--Up.

-- 
Jeff Uphoff - systems/network admin.  |  juphoff@nrao.edu
National Radio Astronomy Observatory  |  jeff.uphoff@linux.org
Charlottesville, VA, USA              |  http://linux.nrao.edu/~juphoff/