Re: Signals and threads



Hi ,
I cannot do a trace since i compiled the pgm for a mips target board,
Also i can say that instead of recompiling the pthread library, we can
change the fork system call "do_fork" like



int do_fork(unsigned long clone_flags, unsigned long stack_start,
struct pt_regs *regs, unsigned long stack_size)
{
int retval;
struct task_struct *p;
struct completion vfork;
#if 1
//my-modifcation
// printk("\nBefore mask%x\n", clone_flags);
clone_flags = clone_flags & (~CLONE_SIGHAND);
// printk("\nAfter mask%x\n", clone_flags);
#endif

.....................
}


Here i am masking out the CLONE_SIGHAND flag and compiled the kernel.
By this the pthread_create call will also will execute without
CLONE_SIGHAND flag.
So we dont need to rebuild the ptheread_lib but have to recompile the
kernel.

Mean while i found out from some debug prints that
1 . the signal function pointer passed while registering the signal is
different in application and form the kernel.
For example

let my signal handler functions are
fun1() addr = 0x123456
fun2() addr = 0x123789

In the kernel i put some prints in do_sighandler function
there it is printing differently like 0x1290909 and same for both the
function!
Any clue??
thanks in advance
thomas

.



Relevant Pages