public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Question about Linux signal handling
@ 2003-02-23 22:29 Albert Cahalan
  2003-02-23 23:43 ` Alan Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Albert Cahalan @ 2003-02-23 22:29 UTC (permalink / raw)
  To: developer_linux; +Cc: linux-kernel

Tom Sanders writes:

> If I catch a signal (SIGUSR2) using "sigaction" call
> then is the signal handler replaced with default
> handling, if I don't install the signal handler again?

That depends on how you set sa_flags. Read the
sigaction man page.

> I remember that in UNIX "signal" system call default
> signal bahavior was to replace the signal handler with
> default after everytime signal was received?

Yes. This is the behavior of all SysV UNIX systems
and Linux kernels. Unfortunately, BSD got it wrong.
Worse, the glibc developers saw fit to ignore both
UNIX history and Linus. They implemented BSD behavior
by making signal() use the sigaction system call
instead of the signal system call. This of course
makes it harder to port apps from SysV UNIX systems
to Linux. Use sigaction() in all new code.





^ permalink raw reply	[flat|nested] 7+ messages in thread
* Question about Linux signal handling
@ 2003-02-23  4:45 Tom Sanders
  2003-02-23 16:30 ` Jesse Pollard
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Sanders @ 2003-02-23  4:45 UTC (permalink / raw)
  To: redhat-list, linux-kernel

If I catch a signal (SIGUSR2) using "sigaction" call
then is the signal handler replaced with default
handling, if I don't install the signal handler again?

I remember that in UNIX "signal" system call default
signal bahavior was to replace the signal handler with
default after everytime signal was received?

My observation is that even if I get same signal
twice, I get the same print (which I have in my signal
handler) again, illustrating that signal handler was
not replaced with default !!! Is that the correct
behavior of "sigaction"?

Thanks,
Tom

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-23 23:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-23 22:29 Question about Linux signal handling Albert Cahalan
2003-02-23 23:43 ` Alan Cox
2003-02-23 23:04   ` Albert Cahalan
2003-02-24  0:20     ` Alan Cox
2003-02-24  0:01   ` Magnus Danielson
  -- strict thread matches above, loose matches on Subject: below --
2003-02-23  4:45 Tom Sanders
2003-02-23 16:30 ` Jesse Pollard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox