Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

signal hanling...

2 views
Skip to first unread message

Coranth Gryphon

unread,
Mar 14, 1995, 2:40:08 PM3/14/95
to
Hi. I'm running on FreeBSD 2.0 (FWIW)

I have run into a discrepency between the man pages for "signal"
and observed (and remembered) behavior.

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

Is the man page incorrect, or is it an optional argument, or what?

Thanx for the info.

-coranth

--------------------------------------------------------+----------------------
Coranth Gryphon | Reality exists on a
| need-to-know basis.
E-Mail: gry...@healer.com, sha...@mv.mv.com |
Pager: (603) 599-0357 Phone: (603) 598-3440 | You do not currently
US-Mail: 11 Carver Street, Nashua, NH 03060-2518 | need to know
Disclaimer: All these words are yours, except Europa... +----------------------

J Wunsch

unread,
Mar 20, 1995, 4:34:52 AM3/20/95
to
Coranth Gryphon <sha...@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_...@uriah.heep.sax.de
http://www.sax.de/~joerg/

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

0 new messages