From: Tom H. <to...@co...> - 2005-11-13 17:27:06
|
In message <200...@ac...> Julian Seward <js...@ac...> wrote: > So in fact .. I'm a bit unclear about this. On the one hand it > seems, buggy kernels pass nonzero values in the upper 16 bits > of this when it should be zero. But on the other hand, the > implication of your commit is that libpthread relies on seeing > the sign of the whole 32 bit value. Can you clarify? The problem is that pthread_cancel uses the tgkill system call to signal the other thread. Now sys_tgkill in the kernel sets si_code to SI_TKILL which is -6 and normally when that siginfo is later copied out to the signal handler the kernel masks off the top 16 bits and then sign extends the bottom 16 so the result in user space is still a negative value. The kernel actually casts si_code to short as it copies it out, just as my patch now does. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |