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

Pavel Emelyanov xemul at parallels.com
Thu Nov 29 12:27:48 EST 2012


On 11/29/2012 09:24 PM, Cyrill Gorcunov wrote:
> 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?

It would, but what would be the use of this API for anything but crtools then?

> 	Cyrill
> .
> 




More information about the CRIU mailing list