summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/atexit.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove names from prototypesrodrigc2015-09-201-2/+2
|
* Add declarations to eliminate -Wmissing-prototypes warnings.rodrigc2015-09-201-0/+3
|
* Silence a warning with GCC that was breaking the build with Juniper's GCC.theraven2014-04-051-1/+2
| | | | Reviewed by: marcel
* Add support for some block functions that come from OS X. These aretheraven2014-04-021-2/+35
| | | | | | | intended to build with any C compiler. Reviewed by: pfg MFC after: 3 weeks
* Do not force to run atexit handlers, which text comes from a dsokib2013-12-061-5/+10
| | | | | | | | | | | | | | | | | owning the handle passed to __cxa_finalize() but which are registered by other dso, when the process is inside exit(3). Running them makes the destruction order wrong, and there is hope that such destructors would not call dlclose(3), since it is pointless at this stage of the process existence. The change effectively disables the r211706 after the exit(3) is called. Reported and tested by: Michael Gmelin <freebsd@grem.de> Analyzed by: dim Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Renumber clauses to reduce diffs to other versionsemaste2013-05-281-1/+1
| | | | | NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3, so follow suit to make comparison easier.
* Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info.kib2010-08-271-1/+1
| | | | | Reported and tested by: Fabian Keil <freebsd-listen fabiankeil de> MFC after: 17 days
* On shared object unload, in __cxa_finalize, call and clear all installedkib2010-08-231-3/+20
| | | | | | | | | | | | | | | | | | | | | | atexit and __cxa_atexit handlers that are either installed by unloaded dso, or points to the functions provided by the dso. Use _rtld_addr_phdr to locate segment information from the address of private variable belonging to the dso, supplied by crtstuff.c. Provide utility function __elf_phdr_match_addr to do the match of address against dso executable segment. Call back into libthr from __cxa_finalize using weak __pthread_cxa_finalize symbol to remove any atfork handler which function points into unloaded object. The rtld needs private __pthread_cxa_finalize symbol to not require resolution of the weak undefined symbol at initialization time. This cannot work, since rtld is relocated before sym_zero is set up. Idea by: kan Reviewed by: kan (previous version) MFC after: 3 weeks
* Style.kib2010-08-231-2/+2
| | | | MFC after: 3 days
* In threaded processes, destroy the mutex atexit_mutex when we'vecperciva2010-06-131-0/+3
| | | | | | | | | | finished using it. This allows the mutex's allocated memory to be freed. This is one sense a rather silly change, since at this point we're less than a microsecond away from calling _exit; but fixing this memory leak is likely to make life easier for anyone trying to track down other memory leaks.
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorkan2003-12-191-7/+101
| | | | | | | | | | | | | C++ ABI document at http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor The ABI was initially defined for ia64, but GCC3 and Intel compilers have adopted it on other platforms. This is the patch from PR bin/59552 with a number of changes by me. PR: bin/59552 Submitted by: Bradley T Hughes (bhughes at trolltech dot com)
* Fix the style of the SCM ID's.obrien2002-03-221-2/+2
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove 'register' keyword.obrien2002-03-211-1/+1
|
* When multiple threads call atexit at the same time, some operations musttegge2002-03-051-2/+28
| | | | | | | | | | be serialized. A mutex is used to protect the critical regions. sbrk() and brk() are not thread safe. Replace use of sbrk() with a call to malloc to avoid race when one thread calls atexit while another thread calls malloc. Reviewed by: deischen
* Merge Lite2 changespeter1997-03-111-1/+3
|
* Don't use malloc, pessimize to use sbrk.phk1996-09-271-1/+2
| | | | fix sbrk manpage while we're at it.
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+66
OpenPOWER on IntegriCloud