*BSD News Article 43524


Return to BSD News archive

Xref: sserve comp.unix.bsd.freebsd.misc:96 comp.os.386bsd.development:3301 comp.os.386bsd.questions:17064 comp.os.386bsd.bugs:3050
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!gmi!zombie.ncsc.mil!news.mathworks.com!udel!gatech!howland.reston.ans.net!Germany.EU.net!zib-berlin.de!irz401!narcisa.sax.de!not-for-mail
From: j@narcisa.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc,comp.os.386bsd.development,comp.os.386bsd.questions,comp.os.386bsd.bugs
Subject: Re: signal hanling...
Date: 20 Mar 1995 10:34:52 +0100
Organization: Private U**x site, Dresden.
Lines: 26
Message-ID: <3kji7s$81j@bonnie.tcd-dresden.de>
References: <D5G3yx.5HL@mv.mv.com>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Coranth Gryphon <shaman@mv.mv.com> wrote:

>The function being installed as the signal handler (to memory and
>on other systems and in practice on FreeBSD) takes an "int" argument.
>The man pages say that it takes "void" (ie. no argument).

Actually not.

typedef void (*__sighandler_t) __P((int));
__sighandler_t signal __P((int, __sighandler_t));

That means, the signal handler takes one `int' argument (the signal
number), and returns nothing.  The signal(3) function takes two
arguments: an `int' (the signal to handle), and the pointer to a
signal handler function, and it returns a pointer to the (previously
installed) signal handler function.

Of course, you are always free to ignore the argument within the
signal handler.  In fact, you'll only wish to use it when installing
the same signal handler for more than one signal.

-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)