--- zzzz-none-000/linux-2.4.17/kernel/signal.c 2001-11-22 00:26:27.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/kernel/signal.c 2004-11-24 13:21:27.000000000 +0000 @@ -14,6 +14,8 @@ #include #include +#include + #include /* @@ -255,8 +257,6 @@ if (!collect_signal(sig, ¤t->pending, info)) sig = 0; - /* XXX: Once POSIX.1b timers are in, if si_code == SI_TIMER, - we need to xchg out the timer overrun values. */ } recalc_sigpending(current); @@ -541,6 +541,27 @@ if (sig < SIGRTMIN && sigismember(&t->pending.signal, sig)) goto out; + /* In case of a POSIX timer generated signal you must check + if a signal from this timer is already in the queue. + If that is true, the overrun count will be increased in + itimer.c:posix_timer_fn(). */ + + if (((unsigned long)info > 1) && (info->si_code == SI_TIMER)) { + struct sigqueue *q; + for (q = t->pending.head; q; q = q->next) { + if ((q->info.si_code == SI_TIMER) && + (q->info.si_tid == info->si_tid)) { + q->info.si_overrun += info->si_overrun + 1; + /* this special value (1) is recognized + only by posix_timer_fn() in itimer.c */ + ret = 1; + goto out; + } + } + } + + TRACE_PROCESS(TRACE_EV_PROCESS_SIGNAL, sig, t->pid); + ret = deliver_signal(sig, info, t); out: spin_unlock_irqrestore(&t->sigmask_lock, flags); @@ -993,11 +1014,13 @@ { siginfo_t info; +// printk("\nsys_rt_sigqueueinfo %u %u %u %u\n",pid,sig,uinfo->si_signo,uinfo->si_int); if (copy_from_user(&info, uinfo, sizeof(siginfo_t))) return -EFAULT; /* Not even root can pretend to send signals from the kernel. Nor can they impersonate a kill(), which adds source info. */ +// printk("\nsys_rt_sigqueueinfo %u %u %u %u\n",pid,sig,info.si_signo,info.si_int); if (info.si_code >= 0) return -EPERM; info.si_signo = sig; @@ -1210,7 +1233,7 @@ #endif /* __sparc__ */ #endif -#if !defined(__alpha__) && !defined(__ia64__) +#if !defined(__alpha__) && !defined(__ia64__) && !defined(__arm__) /* * For backwards compatibility. Functionality superseded by sigprocmask. */ @@ -1238,7 +1261,8 @@ } #endif /* !defined(__alpha__) */ -#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips__) +#if !defined(__alpha__) && !defined(__ia64__) && !defined(__mips__) && \ + !defined(__arm__) /* * For backwards compatibility. Functionality superseded by sigaction. */ @@ -1255,4 +1279,4 @@ return ret ? ret : (unsigned long)old_sa.sa.sa_handler; } -#endif /* !alpha && !__ia64__ && !defined(__mips__) */ +#endif /* !alpha && !__ia64__ && !defined(__mips__) && !defined(__arm__) */