Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ionotify & _NOTIFY_COND_OUTPUT: (2 Items)
   
ionotify & _NOTIFY_COND_OUTPUT  
Hello,
I'm trying to set a _NOTIFY_COND_OUTPUT notification on file descriptor but it never gets armed. _NOTIFY_COND_INPUT 
works fine and so does the select() function with this fd in write set. So maybe the source code of select() function 
would be helpful. I only found source code of _select_event(). I attached a snippet of code. Am I missing something?

fd = open( "/file_path", O_RDWR )
chid = ChannelCreate(0);
coid = ConnectAttach(0, 0, chid, _NTO_SIDE_CHANNEL, 0);
SIGEV_PULSE_INIT( &event, coid, 0, SI_NOTIFY, value );
ionotify( fd, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_OUTPUT, &event );
for(;;) {
   MsgReceive( chid, ...);
} 
Re: ionotify & _NOTIFY_COND_OUTPUT  
On Tue, Oct 16, 2007 at 02:34:15PM -0400, Martin Sevcik wrote:
> Hello,
> I'm trying to set a _NOTIFY_COND_OUTPUT notification on file descriptor
> but it never gets armed. _NOTIFY_COND_INPUT works fine and so does the
> select() function with this fd in write set. So maybe the source code of
> select() function would be helpful. I only found source code of
> _select_event(). I attached a snippet of code. Am I missing something?
> 
> fd = open( "/file_path", O_RDWR )
> chid = ChannelCreate(0);
> coid = ConnectAttach(0, 0, chid, _NTO_SIDE_CHANNEL, 0);
> SIGEV_PULSE_INIT( &event, coid, 0, SI_NOTIFY, value );
> ionotify( fd, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_OUTPUT, &event );
> for(;;) {
>    MsgReceive( chid, ...);
> } 

With _NOTIFY_ACTION_POLLARM you have to check the
return from ionotify() to see if the condition
was satisfied at the time of the call (the POLL
part of POLLARM)

if (ionotify(, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_OUTPUT,) &
   _NOTIFY_COND_OUTPUT) {
	/* handle it */
}

-seanb