On Mon, 16 Jan 2012 13:08:23 -0700 Eric Blake <ebl...@redhat.com> 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 <string.h> 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...