From owner-freebsd-threads@FreeBSD.ORG Thu Apr 27 18:57:45 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C58316A400 for ; Thu, 27 Apr 2006 18:57:45 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C65343D73 for ; Thu, 27 Apr 2006 18:57:44 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.6/8.13.6/NETPLEX) with ESMTP id k3RIvVCT017384; Thu, 27 Apr 2006 14:57:31 -0400 (EDT) Date: Thu, 27 Apr 2006 14:57:31 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: eugeny gladkih In-Reply-To: <8764kusvmh.fsf@amd64.home> Message-ID: References: <200604271700.k3RH0Yp2063767@freefall.freebsd.org> <8764kusvmh.fsf@amd64.home> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: freebsd-threads@freebsd.org Subject: Re: threads/94176: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Apr 2006 18:57:45 -0000 On Thu, 27 Apr 2006, eugeny gladkih wrote: >>>>>> "DE" == Daniel Eischen 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