lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-id: <456796E8.6010409@shaw.ca>
Date:	Fri, 24 Nov 2006 19:05:44 -0600
From:	Robert Hancock <hancockr@...w.ca>
To:	shibu-kundara <thomasece@...il.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Signals and threads

shibu-kundara wrote:
>     Hi
> 
> I have a problem using sigaction function in pthread library.
> I have 2 thread each one registering
> 
> in threadA
>  act1.sa_handler=func1;
>  if(sigaction(SIGUSR1,&act1,NULL)) printf("\nSigaction failed! in th1
> !!\n");
> 
> in threadB
>  act1.sa_handler=func2;
>  if(sigaction(SIGUSR1,&act2,NULL)) printf("\nSigaction failed! in th2
> !!\n");
> 
> but when i send signal SIGUSR1 to threadA , threadA  receives the
> signal
> but the handler func2 is getting called,
> 
> 
> Please let me know is there any way to solve this problem?
> thanks in advance
> thomas
> 

Signal handlers are global to the process. You can't create different 
handlers for the same signal in multiple threads.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@...pamshaw.ca
Home Page: http://www.roberthancock.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ