From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsqlU-0001fV-Tx for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:48:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsqlJ-0001x1-TB for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:48:48 -0400 Received: from mail-qg0-x235.google.com ([2607:f8b0:400d:c04::235]:64648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsqlJ-0001wc-PB for qemu-devel@nongnu.org; Fri, 06 Jun 2014 05:48:37 -0400 Received: by mail-qg0-f53.google.com with SMTP id f51so3869739qge.40 for ; Fri, 06 Jun 2014 02:48:36 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53918E71.2040901@redhat.com> Date: Fri, 06 Jun 2014 11:48:33 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140502124351.GA5296@afflict.kos.to> <1401868140-20928-1-git-send-email-ncopa@alpinelinux.org> <20140606082705.GA28984@afflict.kos.to> In-Reply-To: <20140606082705.GA28984@afflict.kos.to> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] linux-user/signal.c: define __SIGRTMIN/MAX for non-GNU platforms List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio , Natanael Copa Cc: qemu-devel@nongnu.org Il 06/06/2014 10:27, Riku Voipio ha scritto: > Hi, > > On Wed, Jun 04, 2014 at 09:49:00AM +0200, Natanael Copa wrote: >> The __SIGRTMIN and __SIGRTMAX are glibc internals and are not available >> on all platforms, so we define those if they are missing. We also check >> that those corresponds with the posix variables SIGRTMIN/SIGRTMAX which >> may only be available during runtime. >> >> This is needed for musl libc. > > After all, the idea of asserts doesn't work on glibc it seems: > > qemu-arm qemu-smoke/armel/busybox ls -ld . > qemu-arm: linux-user/signal.c:393: signal_init: Assertion `32 == (__libc_current_sigrtmin ())' failed. > Aborted > > Quick test on my amd64/glibc 2.18 system: > > printf("RTMIN: %d RTMAX: %d\n", SIGRTMIN, SIGRTMAX); > RTMIN: 34 RTMAX: 64 > > While: /usr/include/bits/signum.h > #define __SIGRTMIN 32 That's because glibc reserves two signals (one for cancellation, the other to implement set*id system calls). Basically you'd need to extend the hack of host_to_target_signal_table to all signals in the [__SIGRTMIN, SIGRTMIN) range, computing the table at run-time. Paolo