agrosam> Hi all!
agrosam> There are several termination signals like SIGTERM, SIGINT
agrosam> and SIGQUIT etc.
agrosam> These signals are used to tell the process to terminate and
agrosam> we might want to handle these signals by using a certain
agrosam> handler. The default action of all these signals is to
agrosam> cause the process to terminate. And here's the question:
agrosam> how is "termination" exactly performed by the default
agrosam> handler?
there is no "default handler" as such; if the signal action has been
set to SIG_DFL, then all the handling is done in the kernel.
agrosam> Does it call abort(), exit() or _exit() or something else?
It's equivalent to calling _exit() except that the status returned to
the parent process is different, and in the case of some signals a
core file may be generated.
agrosam> Namely, does it call any cleanup handler installed with
agrosam> atexit() or on_exit()
no
agrosam> and does it close open streams
open files are closed, but any user-space buffers (such as are usually
used with FILE*s or C++ streambufs) are _not_ flushed
agrosam> removing temp files,
Temp files created by tmpfile() are removed before the function
returns; they exist only as long as they remain open, and as mentioned
above, open files are closed during process termination. No files are
actually unlinked as part of process termination
agrosam> destroys C++ objects?
no
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>