Re: Signal problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Laurentziu Dascalu

Except SIGKILL and SIGSTOP, you can use  custom signal handler function, which will serve your problem.

atexit can be used, if you want to do some specific tasks just before exiting the program. You can pass a function pointer to atexit.

Shameem



----- Original Message ----
> From: Kent Tu <kachin2@xxxxxxxxx>
> To: Laurentziu Dascalu <dascalu.laurentziu@xxxxxxxxx>
> Cc: "kernelnewbies@xxxxxxxxxxxx" <kernelnewbies@xxxxxxxxxxxx>
> Sent: Friday, September 4, 2009 12:24:14 AM
> Subject: Re: Signal problem
> 
> 
> 
> 
> 
> On Sep 3, 2009, at 11:22 AM, Laurentziu Dascalu 
> > wrote:
> 
> > Hello,
> >
> > I want to "intercept" all possible signals in order to close all the
> > "states" of my application when a SIGKILL || SIGTERM || SEGFAULT ||
> > true arrives. I have some objects that flushes some data on their
> > destructor; all I want is to know how can I do this even if some other
> > application is killing me. I found *atexit()* but it doesn't work.
> >
> > The code is pretty simple:
> >
> > function()
> > {
> >    for-each object in objects_list
> >         delete object;
> > }
> >
> > That function _must_ be executed if the program started (e.g. main()
> > was called). Is there any way I can do this ? How can I do this ?
> >
> > Thanks,
> >
> > -- 
> > Laurențiu Dascălu
> >
> > --
> > To unsubscribe from this list: send an email with
> > "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> > Please read the FAQ at http://kernelnewbies.org/FAQ
> 
> Is this what you are looking for?
> http://linux.die.net/man/2/signal
> 
> 
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ



      

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux