signal for kill -9

Discussion in 'C++' started by Miguel, May 26, 2006.

  1. Miguel

    Miguel Guest

    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
    Miguel, May 26, 2006
    #1
    1. Advertising

  2. Jonathan Mcdougall, May 26, 2006
    #2
    1. Advertising

  3. On 26 May 2006 01:48:27 -0700, "Jonathan Mcdougall"
    <> wrote:
    >Miguel wrote:
    >> What signal have I to take into account in order to capture the 'kill -9
    >> [PID]' call from command shell?

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


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

    Best wishes,
    Roland Pibinger
    Roland Pibinger, May 26, 2006
    #3
  4. Miguel

    Guest

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


    9 is SIGKILL. But you can't capture it. Also 19 or SIGSTOP can't be
    captured.
    , May 26, 2006
    #4
  5. Miguel

    Alex Buell Guest

    On Fri, 26 May 2006 08:37:38 GMT, I waved a wand and this message
    magically appeared:

    > What signal have I to take into account in order to capture the 'kill
    > -9 [PID]' call from command shell?


    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.
    Alex Buell, May 26, 2006
    #5
  6. Miguel

    Tomás Guest

    Miguel posted:

    > What signal have I to take into account in order to capture the 'kill -9
    > [PID]' call from command shell?



    God::Communicate::AskPlatformSpecificQuestion();


    -Tomás
    Tomás, May 26, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ahmed Moustafa

    How to send a kill signal from Eclipse?

    Ahmed Moustafa, Sep 2, 2003, in forum: Java
    Replies:
    4
    Views:
    13,997
    Ahmed Moustafa
    Sep 3, 2003
  2. Michael Pronath
    Replies:
    1
    Views:
    1,134
    Diez B. Roggisch
    Jan 3, 2005
  3. Jack Orenstein

    threading.Thread vs. signal.signal

    Jack Orenstein, Sep 18, 2005, in forum: Python
    Replies:
    0
    Views:
    445
    Jack Orenstein
    Sep 18, 2005
  4. sai krishna

    trap jvm kill signal

    sai krishna, Jun 5, 2007, in forum: Java
    Replies:
    3
    Views:
    931
    sai krishna
    Jun 7, 2007
  5. Swarup Baran

    Handling KILL signal in a perl script

    Swarup Baran, Jul 25, 2006, in forum: Perl Misc
    Replies:
    12
    Views:
    702
    Josef Moellers
    Jul 26, 2006
Loading...

Share This Page