threads/94176: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH

Daniel Eischen deischen at freebsd.org
Thu Apr 27 18:29:36 UTC 2006


On Thu, 27 Apr 2006, eugeny gladkih wrote:

> The following reply was made to PR threads/94176; it has been noted by GNATS.
>
> From: eugeny gladkih <john at drweb.com>
> To: Andriy Gapon <avg at icyb.net.ua>
> Cc: bug-followup at FreeBSD.org, David Xu <davidxu at FreeBSD.org>
> Subject: Re: threads/94176: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH
> Date: Thu, 27 Apr 2006 20:50:59 +0400
>
> >>>>> "AG" == Andriy Gapon <avg at icyb.net.ua> writes:
>
>  AG> David, John,
>
>  AG> maybe it would be beneficial to the general programmer public to add
>  AG> something similar to the NOTES section of the following man page to our
>  AG> man page for sigwait:
>  AG> http://condor.wesleyan.edu/cgi-bin/man.cgi?section=2&topic=sigwait
>
>  AG> Using the original example, it would mean adding something like the
>  AG> following code to get the desired behavior:
>
>  AG> void dummy_handler(int signum)
>  AG> {
>  AG>         return;
>  AG> }
>
>  AG> void *thread(void* unused) {
>  AG>   struct sigaction sa;
>  AG>   sa.sa_handler = dummy_handler;
>  AG>   sigemptyset(&sa.sa_mask);
>  AG>   sa.sa_flags = 0;
>  AG>   sigaction(SIGWINCH, &sa, NULL);
>  AG> .
>  AG> .
>  AG> .
>
>
> why so stupid code should be presented in all software wanted
> just to wait the signal? :(

Why so stupid programs be written to expect non-portable and
non-POSIX behavior?

Seriously, go read the POSIX spec.  Then try your assumptions
on Solaris where it exhibits the same behavior as FreeBSD
with regard to SIGWINCH (or any other ignored signal).

-- 
DE


More information about the freebsd-threads mailing list