how to handle the interrupt from client ??

I am having a client and server. client will send the data to the server. The server is the embedded pc target (X86). whenever client sends the data the server wants to handle the interrupt and calcualte the time at which the interrupt occurs. I know how to get the timestamp. But someone please help me in writing a C code to handle interrupts from client ?? I am analyzing the time at which the interrupt occurs and time at which handler starts executing. PLEASE someone help me .

const struct sigevent *ISR(void *area, int id1)

EndInterruptTime = GetTimeStamp();

InterruptLatency = EndInterruptTime - StartInterruptTime;

measurements[17] = InterruptLatency;

return 0;


volatile int id1; //variables used in the isr should be volatile
struct sigevent event;

int ConfigureISR(void) //void *ISR (void arg)
the software must tell the OS that it wishes to associate the ISR with a particular source of interrupts.

  • On x86 platforms, there are generally 16 hardware Interrupt Request lines (IRQs) */

StartInterruptTime = GetTimeStamp(); //startTime of the interrupt

volatile int irq = 7; //0 : A clock that runs at the resolution set by ClockPeriod()

ThreadCtl (_NTO_TCTL_IO, NULL); // enables the hardware interrupt
// Initialize event structure
event.sigev_notify = SIGEV_INTR;

id1 = InterruptAttach(irq, &ISR, NULL, 0, 0); // ISR is the interrupt service routine


return 0;

I tried writing a code like above but while debugging it is terminating at the interrupt attach api . PLEASE someone help me.

Post the content of GetTimeStamp().

Note that StartInterruptTime is not the start time at all. Even if your program worked, this will not measure what you trying to mesure.

Why don’t you use the system profiler. That will tell you all you want to know and even more precisely then your solution.

oh sorry. I did not post the code of GetTimeStamp. I created a free running timer, If I call that anywhere in my program to get the timestamp. I saw you replying regarding handling interrupts and interrupt latency.

I am also calculating interrupt latency.
requirement : Client is sending data to embedded pc (server : FIT PC2 with QNX RTOS). when server receives an interrupt then I have to get the timestamp. How to handle the interrupt on the server side ??

I cant use system profiler because I (server) am calculating the timestamp, when the interrupt occurs and storing in a memory. Later sending the timestamp back to client.

my question : How to handle the interrupt from client on the server side ??
could you please give me a small example ??