This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cyg_libc_invoke_atexit_handlers


On Wed, May 16, 2007 at 02:09:55PM -0700, Paul D. DeRocco wrote:
> I notice that after my "cyg_user_start" function returns, "exit" is called,
> which in turn calls "cyg_libc_invoke_atexit_handlers". This function has a
> "cyg_" prefix, so is apparently part of eCos, and not some immutable part of
> the C library, so I assume it has some intended use. But I don't understand
> why one would want an atexit handler to be called at the end of system
> initialization. (I also notice that the destruction of static C++ objects is
> fortunately _not_ done by an atexit handler, the way it is with some C++
> compilers; indeed my system has no atexit handlers at all.) Since eCos has
> no standard shutdown mechanism, is there some reason that atexit handlers
> are called at all?

Im no expert here......

Is this something special for main(), or is it generic for all
threads?  eCos threads are allowed to exit, since they can be short
lived. POSIX probably states that exiting threads run their atexit
handlers. So when main() exists its atexit handlers get called.

          Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]