Connecting Tech Pros Worldwide Help | Site Map

signal for kill -9

  #1  
Old May 26th, 2006, 09:45 AM
Miguel
Guest
 
Posts: n/a
What signal have I to take into account in order to capture the 'kill -9
[PID]' call from command shell?

the code is something like this

void manager(int i){
printf("%d\n",i);
system("chmod 644 prueba.mig");
exit(0);
}

int main(){
int fd;
signal(SIGINT,manager);
signal(SIGKILL,manager);
fd = create("prueba.mig");
while(1==1){}
}

thank you in advance.

Miguel

  #2  
Old May 26th, 2006, 10:03 AM
Jonathan Mcdougall
Guest
 
Posts: n/a

re: signal for kill -9


Miguel wrote:[color=blue]
> What signal have I to take into account in order to capture the 'kill -9
> [PID]' call from command shell?[/color]

This newsgroup deals with standard C++ only. Please refer to
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9 for
newsgroup suggestions.


Jonathan

  #3  
Old May 26th, 2006, 10:15 AM
Roland Pibinger
Guest
 
Posts: n/a

re: signal for kill -9


On 26 May 2006 01:48:27 -0700, "Jonathan Mcdougall"
<jonathanmcdougall@gmail.com> wrote:[color=blue]
>Miguel wrote:[color=green]
>> What signal have I to take into account in order to capture the 'kill -9
>> [PID]' call from command shell?[/color]
>
>This newsgroup deals with standard C++ only. Please refer to
>http://www.parashift.com/c++-faq-lit...t.html#faq-5.9 for
>newsgroup suggestions.[/color]

Some signals (e.g. SIGINT) are defined for Standard C and C++.

Best wishes,
Roland Pibinger
  #4  
Old May 26th, 2006, 10:25 AM
ramashishb@gmail.com
Guest
 
Posts: n/a

re: signal for kill -9


Miguel wrote:[color=blue]
> What signal have I to take into account in order to capture the 'kill -9
> [PID]' call from command shell?[/color]

9 is SIGKILL. But you can't capture it. Also 19 or SIGSTOP can't be
captured.

  #5  
Old May 26th, 2006, 02:45 PM
Alex Buell
Guest
 
Posts: n/a

re: signal for kill -9


On Fri, 26 May 2006 08:37:38 GMT, I waved a wand and this message
magically appeared:
[color=blue]
> What signal have I to take into account in order to capture the 'kill
> -9 [PID]' call from command shell?[/color]

You cannot do that. If it was possible to capture that, you'd end up
with processes that cannot be killed off. You'd have to power-cycle.
--
http://www.munted.org.uk

Take a nap, it saves lives.
  #6  
Old May 26th, 2006, 04:35 PM
Tomás
Guest
 
Posts: n/a

re: signal for kill -9


Miguel posted:
[color=blue]
> What signal have I to take into account in order to capture the 'kill -9
> [PID]' call from command shell?[/color]


God::Communicate::AskPlatformSpecificQuestion();


-Tomás
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gracefully kill a console app? Jon Davis answers 5 November 28th, 2006 07:45 PM
kill -2 Jord Tanner answers 8 November 23rd, 2005 12:38 AM
Proper way to kill child processes Bob Swerdlow answers 6 July 18th, 2005 12:54 PM
Waiting for processes to finish under Solaris Behrang Dadsetan answers 1 July 18th, 2005 01:35 AM