From owner-svn-src-head@FreeBSD.ORG Wed Jun 30 16:05:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2355B106564A for ; Wed, 30 Jun 2010 16:05:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E8E298FC0A for ; Wed, 30 Jun 2010 16:05:30 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7DC3B46B0C; Wed, 30 Jun 2010 12:05:30 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 845AE8A03C; Wed, 30 Jun 2010 12:05:29 -0400 (EDT) From: John Baldwin To: Matthew Jacob Date: Wed, 30 Jun 2010 12:05:14 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006292044.o5TKiJd7031766@svn.freebsd.org> <201006300934.47629.jhb@freebsd.org> <4C2B4DC6.1050404@feral.com> In-Reply-To: <4C2B4DC6.1050404@feral.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201006301205.14133.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 30 Jun 2010 12:05:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Ed Schouten Subject: Re: svn commit: r209595 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2010 16:05:31 -0000 On Wednesday 30 June 2010 9:59:34 am Matthew Jacob wrote: > Excuse my ignorance, but aren't signals supposed to be to processes, not > specific threads? Not for synchronous events. For example, when you get a segfault due to a NULL pointer the SIGSEGV is sent to the thread that actually segfaulted, not any random thread in the process. Similarly for floating-point exceptions, etc. POSIX also mandates this for SIGPIPE as you can see from this description of 'EPIPE' from write(2) and fflush(3): [EPIPE] An attempt is made to write to a pipe or FIFO that is not open for reading by any process, or that only has one end open. A SIGPIPE signal shall also be sent to the thread. (Note thread, not process, in other places the language uses process, but it specifically uses thread here.) > My memory/knowledge of Posix in this area is very rusty. > > > On Tuesday 29 June 2010 5:05:22 pm Ed Schouten wrote: > > > >> * John Baldwin wrote: > >> > >>> Log: > >>> Send SIGPIPE to the thread that issued the offending system call > >>> rather than to the entire process. > >>> > >> Should something similar be used inside the TTY layer, where > >> reads/writes may cause signals to be generated? > >> > > Hmm, I'm not sure. I do think you want to stop the entire process for SIGTTOU > > or SIGTTIN (often the entire process group it seems), so I'm not sure if it > > matters if the signal is sent to only the current thread versus sending it to > > any thread in the process. > > > > > > -- John Baldwin