How to handle multiple timer signals
<pre><code>int main ()
{
        int i=0;
        timer_t t_id[100];
        for(i=0; i&lt;100; i++)
        makeTimer(NULL, &amp;t_id[i], i+1, 0);

        /* Do busy work.  */
        while (1);
}





static int makeTimer( char *name, timer_t *timerID, int sec, int msec ) 
    { 
        struct sigevent         te; 
        struct itimerspec       its; 
        struct sigaction        sa; 
        int                     sigNo = SIGRTMIN; 

        /* Set up signal handler. */ 
        sa.sa_flags = SA_SIGINFO; 
        sa.sa_sigaction = timer_handler; 
        sigemptyset(&amp;sa.sa_mask); 

        if (sigaction(sigNo, &amp;sa, NULL) == -1) 
        { 
            printf("sigaction error\n");
            return -1; 
        } 

        /* Set and enable alarm */ 
        te.sigev_notify = SIGEV_SIGNAL; 
        te.sigev_signo = sigNo; 
        te.sigev_value.sival_ptr = timerID; 
        timer_create(CLOCK_REALTIME, &amp;te, timerID); 

        its.it_interval.tv_sec = sec;
        its.it_interval.tv_nsec = msec * 1000000; 
        its.it_value.tv_sec = sec;

        its.it_value.tv_nsec = msec * 1000000;
        timer_settime(*timerID, 0, &amp;its, NULL); 

        return 0; 
    }

    static void timer_handler( int sig, siginfo_t *si, void *uc ) 
    { 
        timer_t *tidp;
        tidp = si-&gt;si_value.sival_ptr;

       /* how to know the timer_id with index? */
    }
</code></pre>

<p>On this code, I made a number of timers which id is made from array structure.</p>

<p>If the time out event has occurred, then all the timer shares the one timer_handler. But how can I know which index's(t_id[index]) time out has occurred? </p>

<p>Is it possible? I mean I want to know which index's time out has occurred.</p>