Problem using TimerTimeout() with InterruptWait()

Hello,
I have read all post and manuals about TimerTimeout in this forum and QNX site, but I can’t understand where is my problem.

There is my code:

[code] int errvalue;
uint64_t timeout = 10000000000;

	TimerTimeout( CLOCK_REALTIME,_NTO_TIMEOUT_INTR ,&event, &timeout, NULL );
    status=InterruptWait (0, NULL);
    if (status < 0 ){ // error
    	errvalue = errno;
    	switch(errvalue){
    	case(EINTR): puts("The call was interrupted by a signal. ");
    		break;
    	case(ENOTSUP):puts("The reserved arguments aren't NULL. ");
    		break;
    	case(ETIMEDOUT):puts("TIMEOUT !!!. A kernel timeout unblocked the call. ");
    		break;
    	}
    }
    else{//  normal interrupt
    	puts("Interrupt !!!");
    }

[/code]

I am waiting for interrupt for 10s and after that I should get TIMEOUT status from InterruptWait but all the time I get normal interrupt status. It looks like normal interrupt, I can’t determinate what unblocked InterruptWait. All the time it looks like interrupt. Please check my code and tell me maybe my code is missing something.

After every 10s or when I fire interrupt, I get:
“Interrupt !!!”
but if there was no interrupt I should get:
"TIMEOUT !!!. A kernel timeout unblocked the call. "

Any comments are welcome.
Thanks!

when I changed this line: TimerTimeout( CLOCK_REALTIME,_NTO_TIMEOUT_INTR, &event, &timeout, NULL );
to this: TimerTimeout( CLOCK_REALTIME,_NTO_TIMEOUT_INTR, &event, NULL, NULL );
I got correct answer:"TIMEOUT !!!. A kernel timeout unblocked the call. "

But why TimerTimeout() is not working as it should when I set timeout value ?!
Actualy it’s working just without notification ETIMEDOUT.

Darkusas,

What event type are you putting in your event variable in the TimerTimeout call?

According to the docs for TimerTimeout you have to put SIGEV_UNBLOCK. In fact the docs go further and say that the 3rd parameter (your event variable) should be NULL if you want to generate an ETIMEDOUT kernel response.

So I’d try putting back your timeout and replacing event with NULL in TimerTimeout and see if that fixes your problem.

Tim

Thank you Tim,
You are right, I just set 3rd parameter to NULL and everything works OK now.

TimerTimeout( CLOCK_REALTIME,_NTO_TIMEOUT_INTR, NULL, &timeout, NULL ); 

I am very grateful to You !

Best regards,
Darkusas