Unix Programming - Blocking signals to a process

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2007 > Blocking signals to a process





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Blocking signals to a process
Rafael Almeida

2007-06-24, 7:22 am

Hello,

I'd like to know if there's some way of blocking signals to a certain
process. Even if it sets a handler with signal or sigaction I want the
signal to never arrive to the process. Is there any way of doing that?

I noticed that if I block the signal and then fork a child process, if
the child sets a signal handler, then it's able to get the signals. In
particular, I want to block SIGALRM to ever reaching some process.

I'm using linux, so linux-specific solutions are ok.
phil-news-nospam@ipal.net

2007-06-24, 7:22 am

On Sun, 24 Jun 2007 03:30:12 -0300 Rafael Almeida <rafaelc@dcc.ufmg.br> wrote:
| Hello,
|
| I'd like to know if there's some way of blocking signals to a certain
| process. Even if it sets a handler with signal or sigaction I want the
| signal to never arrive to the process. Is there any way of doing that?
|
| I noticed that if I block the signal and then fork a child process, if
| the child sets a signal handler, then it's able to get the signals. In
| particular, I want to block SIGALRM to ever reaching some process.
|
| I'm using linux, so linux-specific solutions are ok.

You can do it from within the process:

man sigsetmask


If you want to do it from outside the process:

man ptrace

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-06-24-0717@ipal.net |
|------------------------------------/-------------------------------------|
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com