From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUYH1-0005n3-GO for qemu-devel@nongnu.org; Thu, 09 Jun 2011 01:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUYH0-0006ar-8w for qemu-devel@nongnu.org; Thu, 09 Jun 2011 01:59:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUYGz-0006ae-Vd for qemu-devel@nongnu.org; Thu, 09 Jun 2011 01:59:18 -0400 Message-ID: <4DF0612D.1040805@redhat.com> Date: Thu, 09 Jun 2011 07:59:09 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1307573737-33421-1-git-send-email-agraf@suse.de> In-Reply-To: <1307573737-33421-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] sigfd: use pthread_sigmask List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Jan Kiszka , =?UTF-8?B?QW5kcmVhcyBG?= =?UTF-8?B?w6RyYmVy?= , qemu-devel Developers On 06/09/2011 12:55 AM, Alexander Graf wrote: > Qemu uses signalfd to figure out, if a signal occured without the need > to actually receive the signal. Instead, it can read from the fd to rec= eive > its news. > > Now, we obviously don't always have signalfd around. Especially not on > non-Linux systems. So what we do there is that we create a new thread, > block that thread on all signals and simply call sigwait to wait for a > signal we're interested in to occur. > > This all sounds great, but what we're really doing is: > > sigset_t all; > > sigfillset(&all); > sigprocmask(SIG_BLOCK,&all, NULL); > > which - on Darwin - blocks all signals on the current_process_, not onl= y > on the current thread. To block signals on the thread, we can use > pthread_sigmask(). > > This patch does that, assuming that my above analysis is correct, and t= hus > renders Qemu useable on Darwin again. > > Reported-by: Andreas F=C3=A4rber > CC: Paolo Bonzini > CC: Jan Kiszka > CC: Anthony Liguori > Signed-off-by: Alexander Graf Acked-by: Paolo Bonizni Paolo