Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - IOFUNC_NOTIFY_* macros: (1 Item)
   
IOFUNC_NOTIFY_* macros  
I've added this to the documentation for iofunc_notify_trigger():

-------------------------------------------------------------
The sys/iofunc.h file also defines the IOFUNC_NOTIFY_INPUT_CHECK(), IOFUNC_NOTIFY_OUTPUT_CHECK(), and 
IOFUNC_NOTIFY_OBAND_CHECK() macros, which you can use to see if there are enough bytes in the lists to make it 
worthwhile to call iofunc_notify_trigger() to notify clients about:

#define IOFUNC_NOTIFY_INPUT_CHECK(__nop, __cnt, __tran)	...
#define IOFUNC_NOTIFY_OUTPUT_CHECK(__nop, __cnt) ...
#define IOFUNC_NOTIFY_OBAND_CHECK(__nop, __cnt, __tran)	...

The arguments are:

__nop
    An array of three iofunc_notify_t structures that represent (in order), the input, output, and out-of-band 
notification lists whose entries you want to examine. 
__cnt
    The count that you want to compare to the trigger value for the event. 
__tran
    (IOFUNC_NOTIFY_INPUT_CHECK() and IOFUNC_NOTIFY_OBAND_CHECK() only) Nonzero if you want to arm the trigger when the 
list makes the transition from empty to nonempty (for example, as mq_notify() does). 
-------------------------------------------------------------

Did I get it all right? The __tran argument was a bit tricky to figure out.

I also added the following to the docs for iofunc_notify():
-------------------------------------------------------------
The sys/iofunc.h file also defines the following macros that work with the arrays of iofunc_notify_t structures:

#define IOFUNC_NOTIFY_DISARM(__nop, __index) ...
    Disarm the list specified by __index in __nop. 
#define IOFUNC_NOTIFY_INIT(__nop) ...
    Initialize the three lists in __nop. 
-------------------------------------------------------------

The definition of IOFUNC_NOTIFY_INIT() specifically works on three lists, but the docs for iofunc_notify() also say:

-------------------------------------------------------------
Traditionally this array contained three members which represent, in order, the input, output, and out-of-band 
notification lists. Since the addition of extended events (see below), three is now the minimum size of this array. The 
actual size must support indexing by the conditions being triggered up to _NOTIFY_MAXCOND. 
-------------------------------------------------------------
Is this discrepancy a problem?

Thanks for any help with this.