On Wed, 24 Jun 2020 at 21:12, Richard Cochran <richardcoch...@gmail.com> wrote: > > On Wed, Jun 24, 2020 at 09:01:33PM +0300, Vladimir Oltean wrote: > > I think it boils down to something very simple. > > The kernel is waking up a user process with revents = POLLIN | > > POLLERR. That has a certain meaning. > > Then the process says "Oh, yay, I have revents = POLLIN. Let me > > process that!". That has an entirely different meaning. > > I agree. > > In this specific case, if POLLERR appears, it means that some unknown > error occurred, and the application can't do anything about it beyond > throwing a generic fault. This is what I would call "defensive" > programming. >
Treating it in a meaningful way for what it is, or for what it can be in the future (an event on an error/control socket) is defensive programming. Treating it as an event on a data queue is a bug. > If and when the kernel introduces new POLLERR events, we will of > course implement the appropriate handlers. But as of today there are > no such events to handle. > > Thanks, > Richard > Thanks, -Vladimir _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel