Silly question about interrupt catching...

hi,
I’m sorry for the triviality of question, but…

if I use signal() in this way

signal(SIGINT, myFunc);

and inside myFunc

void myFunc(int sig_no) {
. . .
// read data from a device
}

is possible to know which interrupt is raised?
I mean, there is a way to run myfunc only if I receive a particular Interrupt (for example INT 9 ) and continue to sleep if any other is received?

thanks…

SIGINT - Interactive attention signal
has nothing to do with interrupts

Read the docs on InterruptAttach, InterruptAttachEvent and InterruptWait
and PLEASE also read the section on writing an interrupt handler in the Programmer’s guide.

and so why I found on th QNX help “Interrupt” as meaning of “SIGINT” ?

however…I’ve done:

. . .
signal (SIGINT, myFunc);
. . .

the proces is blocked.
when I press ctrl+c it runs myFunc.
now I would like to know which signal I need to start myFunc only when data are sent…
my board is setted to generate an interrupt(in this case INT9) on data reception…

thanks

well, this is none of my business, but I hope I am right when I say that
interrupt != signal
because an interrupt is a hardware thing whereas a signal is a software thing.

As you need to work with INT9 you should have a look at the functions cburgess sugguested above.

OK, the help says “SIGINT → Interrupt.”, but this has nothing to do with the kind of interrupts you are talking about. It is only a signal that can interrupt (i.e. intercept) your program. No connection to your INT9. None. Not at all.

until here no problems. I know that…

ok, said in this way is more comprehensible…

I’ve tryed to use interruptwaiting & Co. but it seems not to receive the interrupt…now, I’ve enabled interrupts on my board and changeed some settings but nothing really’s gonna happened…

This is like saying I tried to start my car with the key but it didnt work... Maybe if you would tell use how and where you used the key it would be easier for us to help you. Youd be surprise how many peope think their car should work by just waving the key at the car :wink: