From owner-freebsd-hackers Mon Feb 4 18: 6:33 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from imr1.aus.deuba.com (bagheera.aus.deuba.com [203.0.62.7]) by hub.freebsd.org (Postfix) with ESMTP id 72B0B37B429 for ; Mon, 4 Feb 2002 18:06:27 -0800 (PST) Received: from bmr1-e1.aus.deuba.com by imr1.aus.deuba.com id g1526OP26019; Tue, 5 Feb 2002 13:06:25 +1100 (EST) Received: from mailhost.aus.deuba.com [10.179.4.6] by bmr1-e1.aus.deuba.com id g1526On05373; Tue, 5 Feb 2002 13:06:24 +1100 (EST) Received: from merton.aus.deuba.com (merton.aus.deuba.com [10.179.88.22]) by mailhost.aus.deuba.com (8.9.1/8.9.1) with SMTP id NAA21660 for ; Tue, 5 Feb 2002 13:06:23 +1100 (EST) Received: (qmail 75169 invoked by uid 107); 5 Feb 2002 02:06:23 -0000 Message-ID: <20020205020623.75168.qmail@merton.aus.deuba.com> From: callum.gibson@db.com Subject: pthread_sigmask problem To: hackers@freebsd.org Date: Tue, 5 Feb 2002 13:06:23 +1100 (EST) X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi all, I have an application which attempts to block all signals using pthread_sigmask(). I'm aware that this only works on the current thread, however this call occurs before any other threads are created and so should be inherited. I call it as follows: sigset_t signalSet; (void)sigfillset(&signalSet); (void)pthread_sigmask(SIG_BLOCK, &signalSet, NULL); However, it seems that signals such as SIGPIPE, SIGINT, etc will still kill the process. I also tried replacing the pthread_sigmask call with sigprocmask to see if it made any difference, which it didn't. The only other relevant info I can think of, is that I start up another thread specifically for catching SIGTERM, thusly: (void)sigemptyset(&signalSet); (void)sigaddset(&signalSet, SIGTERM); if (sigwait(&signalSet, &signo) < 0 || signo != SIGTERM) /* some error handling */; /* shutdown cleanly */ etc. This part still works as expected. Additionally, I have the same code working under Solaris threads (not pthreads on Solaris) fine, the only relevant change being the call thr_sigsetmask instead of pthread_sigmask. The same behaviour is exhibited on 4.3-RELEASE and 4.4-RELEASE. Any ideas on what is wrong? regards, Callum (c)2002 Callum Gibson callum.gibson@db.com Global Markets IT, Deutsche Bank, Australia 61 2 9258 1620 ### The opinions in this message are mine and not Deutsche's ### To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message