Re: About kevent

From: John-Mark Gurney <jmg_at_funkthat.com>
Date: Fri, 28 Feb 2014 09:46:52 -0800
Kohji Okuno wrote this message on Fri, Feb 28, 2014 at 21:29 +0900:
> > Kohji Okuno wrote this message on Fri, Feb 28, 2014 at 11:13 +0900:
> >> I have a question about kevent.
> >> 
> >> How should the userland judge knote which is cleared from knlist by
> >> knlist_clear() or knlist_delete()?
> > 
> > It looks like I need to read the code better...  knlist_clear (killkn=0)
> > and knlist_delete (killkn=1) are wrappers around knlist_cleardel...
> > 
> > Looking at the code of knlist_cleardel, if killkn is set
> > (knlist_delete) the knote will be dropped (free'd)... if it is not set,
> > the flags _EOF and _ONESHOT will be set such that it'll be returned
> > soon..
> > 
> > Now that I look at the code, KNOTE_ACTIVATE is never called to be put
> > on the list to be delivered, so now I'm not sure if it works the way
> > it's suppose to... I have a feeling that the notes might hang around
> > forever until the kq fd is closed...
> > 
> > I'm also puzzled as to why _DETACHED isn't set, which would seem to
> > mean that we'll call f_detach when we close the kq, which I assume
> > could cause a panic...
> > 
> > This needs to be investigated/tested...
> 
> Thank you for your comment.
> 
> I tried test by usb_dev. When a USB device is lost suddenly, I can
> receive EV_EOF|EV_ONESHOT on kevent->flags.

Ok, good, that means the documentation in knlist_clear(9) is correct...

Thanks for verifing this for me...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
Received on Fri Feb 28 2014 - 16:46:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:47 UTC