Connecting Tech Pros Worldwide Help | Site Map

signal for kill -9

Miguel
Guest
 
Posts: n/a
#1: May 26 '06
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

Jonathan Mcdougall
Guest
 
Posts: n/a
#2: May 26 '06

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

Roland Pibinger
Guest
 
Posts: n/a
#3: May 26 '06

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
ramashishb@gmail.com
Guest
 
Posts: n/a
#4: May 26 '06

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.

Alex Buell
Guest
 
Posts: n/a
#5: May 26 '06

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.
Tomás
Guest
 
Posts: n/a
#6: May 26 '06

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