Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2006 14:57:31 -0400 (EDT)
From:      Daniel Eischen <deischen@freebsd.org>
To:        eugeny gladkih <john@drweb.com>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: threads/94176: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH
Message-ID:  <Pine.GSO.4.64.0604271450360.25542@sea.ntplx.net>
In-Reply-To: <8764kusvmh.fsf@amd64.home>
References:  <200604271700.k3RH0Yp2063767@freefall.freebsd.org> <Pine.GSO.4.64.0604271424400.25542@sea.ntplx.net> <8764kusvmh.fsf@amd64.home>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 27 Apr 2006, eugeny gladkih wrote:

>>>>>> "DE" == Daniel Eischen <deischen@freebsd.org> writes:
>
> 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? :(
>
> DE> Why so stupid programs be written to expect non-portable and
> DE> non-POSIX behavior?
>
> DE> Seriously, go read the POSIX spec.  Then try your assumptions
> DE> on Solaris where it exhibits the same behavior as FreeBSD
> DE> with regard to SIGWINCH (or any other ignored signal).
>
> no, Solaris & Linux go the right way, this code are used on them
> both, and AIX, too. and even FreeBSD 4.x and 5.X with
> libc_r. your comments?

Not true.  I just tested it on Solaris 9.  If you don't
install a signal handler for SIGWINCH, it is ignored.
I also compiled my test program on Solaris with
-D_POSIX_PTHREAD_SEMANTICS and linked with -lpthread.

   http://people.freebsd.org/~deischen/kse/test_waitone.c

-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0604271450360.25542>