From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rmt2D-00054j-S3 for qemu-devel@nongnu.org; Mon, 16 Jan 2012 15:20:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rmt2C-0007Jj-2g for qemu-devel@nongnu.org; Mon, 16 Jan 2012 15:20:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rmt2B-0007JL-My for qemu-devel@nongnu.org; Mon, 16 Jan 2012 15:20:04 -0500 Date: Mon, 16 Jan 2012 18:19:34 -0200 From: Luiz Capitulino Message-ID: <20120116181934.2914f46f@doriath> In-Reply-To: <4F1483B7.2010105@redhat.com> References: <1326482122-12619-1-git-send-email-lcapitulino@redhat.com> <1326482122-12619-3-git-send-email-lcapitulino@redhat.com> <4F10A694.8030900@redhat.com> <20120116150853.40626823@doriath> <4F1483B7.2010105@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-ga: Add the guest-suspend command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: jcody@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Mon, 16 Jan 2012 13:08:23 -0700 Eric Blake wrote: > On 01/16/2012 10:08 AM, Luiz Capitulino wrote: > >> Strangely enough, POSIX doesn't include strcmp() in its list of > >> async-signal-safe functions (which is what you should be restricting > >> yourself to, if qemu-ga is multi-threaded), but in practice, I think > >> that is a bug of omission in POSIX, and not something you have to change > >> in your code. > > > > memset() ins't either... sigaction() either, which begins to get > > annoying. > > sigaction() is required by POSIX to be async-signal-safe. Where are you > looking when claiming it isn't? I did a bad search on: http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html when I wrote that email. A few seconds later I saw that sigaction() is there. > memset(), strlen, strcpy, and friends in are all in the class > of functions that I think are unintentional omissions from the list of > async-signal-safe functions (they don't read/modify anything but the > pointers passed in, so the _only_ reason I can think of why they _might_ > have been omitted from the list is that there might be some machine > state that could be observably different if you were interrupted in the > middle of one of these operations, such as a processor flag bit when > using a rep prefix on x86 controlling which direction to move, but no > one has ever pointed me to a definitive answer to why they were omitted). If this is right we shouldn't be using them then...