qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: add ppoll syscall support


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] linux-user: add ppoll syscall support
Date: Sun, 23 Jan 2011 22:35:42 +0000

On 23 January 2011 21:35, Mike Frysinger <address@hidden> wrote:
> On Sun, Jan 23, 2011 at 16:25, Peter Maydell wrote:
>> This looks wrong -- ppoll() is supposed to be atomic, but
>> your implementation isn't. Why can't we just implement this
>> by calling the host ppoll? (might need a configure test, but
>> that's straightforward.)
>
> it's atomic from the apps' point of view, so what does it matter ?

It's not atomic because signals can arrive in the gaps
between your calls to sigaction and poll (even if qemu doesn't
deliver them to the guest until we're done). ppoll() is supposed
to return EINTR if interrupted by a signal, but if a signal arrives
before you call poll() then you won't notice it so you won't
return, and the app might hang.

Looks like this same issue came up with a proposed pselect
patch last year:
http://www.mail-archive.com/address@hidden/msg28339.html
(together with some remarks about it being better not to
trust buggy libcs and go straight for the host syscall.)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]