Subject: selnotify: knhint?
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 01/30/2005 01:57:14
I'm porting some code forward to 2.0 (the same stuff that prompted my
recent question about cdevsw, as it happens), and have a question.

The old code uses selrecord/selwakeup.  The section-9 manpage for them
in 2.0 says, in part,

     selnotify() calls selwakup() and then calls KNOTE() with knhint.  In most
     cases, selnotify() should be used rather than using selwakeup() directly.

However, I am unable to find documentation which describes suitable
values for knhint.  knote(9) says that that argument "is used to pass
in additional information, which may not be present in the data
structure that the filter examines", which offers little to no guidance
in selecting a value.  I also see nothing that helps in determining
whether mine is one of the exceptional cases when calling selwakeup()
is right.

Looking at code in sys/kern suggests NOTE_SUBMIT and 0 are likely
candidates; grepping in sys/dev argues for 0.  But neither gives much
help in choosing a value, except possibly for picking 0 because that's
what most of sys/dev uses.

Is this really not yet documented, or have I just missed something?
(For the time being, I'm using selwakeup().)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B