Connecting Tech Pros Worldwide Help | Site Map

signal for kill -9

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 26th, 2006, 08:45 AM
Miguel
Guest
 
Posts: n/a
Default signal for kill -9

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, 09:03 AM
Jonathan Mcdougall
Guest
 
Posts: n/a
Default 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, 09:15 AM
Roland Pibinger
Guest
 
Posts: n/a
Default 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, 09:25 AM
ramashishb@gmail.com
Guest
 
Posts: n/a
Default 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, 01:45 PM
Alex Buell
Guest
 
Posts: n/a
Default 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, 03:35 PM
Tomás
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.