lkml.org 
[lkml]   [2005]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Strangeness with signals
From
Date
Simon Kirby <sim@netnation.com> writes:

> Hi folks,
>
> I'm not sure if this is buggy, strange or just perfectly normal
> behaviour. I was trying to write an application that does some simple
> network performance polling with setitimer() and also keeps a look out
> for SIGWINCH to see if the window size changes. I was interested to
> find out that when I resized the window, the signal was never noticed.
> Even more interesting is the fact that if I run it in strace or even
> GDB to figure out what's going on, it works!
>
> I've simplified the program to this simple test case which will show
> clearly that (both on 2.4 and 2.6), SIGALRM and SIGHUP are received as
> expected but that without setting a special sa_sigaction handler,
> SIGWINCH and SIGCHLD don't appear to wake up sigwaitinfo(). Also,
> applying a sigaction() to all signals won't change the situation unless
> an sa_sigaction is set; sa_handler does not appear to change anything.
>
> Some people mentioned blocked and ignored signals, but as can be seen in
> this example, differing behaviour can be seen across signals even with
> all signals blocked and ignored.

The SIGWINCH and SIGCHLD signals are not generated if their
disposition is set to SIG_DFL. I believe SIGCONT and SIGURG also
behave similarly. If you want to see them from your application, you
have to establish a (potentially empty) signal handler.

Phil.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-28 03:22    [W:0.286 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site