[CRIU] [PATCH 2/3] signalfd: add ability to get signal without removing from the queue

Cyrill Gorcunov gorcunov at openvz.org
Thu Nov 29 12:24:26 EST 2012


On Thu, Nov 29, 2012 at 09:04:11PM +0400, Pavel Emelyanov wrote:
> On 11/29/2012 08:51 PM, Andrey Vagin wrote:
> > signalfd should be called with the flag SFD_PEEK.
> > 
> > The operation read() returns siginfo, but the signal remains in a queue.
> > signalfd has an internal offset, which is incremented on each siginfo
> > and the next siginfo is choosen according with this offset in the queue.
> 
> It's not nice. It's designed for one-shot reading which is not great.
> IOW -- I create such fd, then peek one signal, then handle one. The signal
> gets removed from queue. Then I get one more signal, but read from this
> fd will report nothing, as offset is 1 and doesn't decrease.

Would this be valid if task is stopped?

	Cyrill


More information about the CRIU mailing list