From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: Improving Shepherd Date: Thu, 15 Feb 2018 14:04:37 -0500 Message-ID: <87k1vem5ve.fsf@netris.org> References: <871si8bc5g.fsf@zancanaro.id.au> <877errn23f.fsf@zancanaro.id.au> <871shzeg8m.fsf@gnu.org> <87a7wbu2ht.fsf@gnu.org> <871shmji8o.fsf@fsfe.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emOqL-0007Jj-2C for guix-devel@gnu.org; Thu, 15 Feb 2018 14:05:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emOqH-0006IZ-31 for guix-devel@gnu.org; Thu, 15 Feb 2018 14:05:17 -0500 In-Reply-To: <871shmji8o.fsf@fsfe.org> (Jelle Licht's message of "Thu, 15 Feb 2018 18:05:43 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Jelle Licht Cc: guix-devel Jelle Licht writes: > tl;dr: I cannot seem to block signals from being handled by guile in > some way, which to me seems a prerequisite for using signalfd-based > signal handling. My uneducated guess is that guile needs to support a > way to set signal masks for all threads in order to deal with this. Does POSIX provide a way to set the signal mask for another thread? Last time I looked, I couldn't find one. I've long desired to get rid of the signal thread in Guile, and instead arrange for signals to be delivered directly to the thread that's supposed to receive it. Guile's 'sigaction' has long allowed the user to specify which thread should receive each kind of signal, although POSIX doesn't support this. I want to do this for a couple of reasons. One is to avoid spawning threads unless the user asks for it, to avoid possible safety issues with fork. Another reason is that I'd like to arrange for long-running system calls to be reliably interrupted when a signal is received. The main thing I've been stuck on is that I haven't found a way to set the signal mask on other threads. Mark