aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib/quick_exit.c
AgeCommit message (Collapse)AuthorFilesLines
2017-02-13Only define static locks in multithreaded modeThomas Preud'homme1-0/+6
Newlib build system defines __SINGLE_THREAD__ to allow concurrency code to be only compiled when newlib is configured for multithread. One such example are locks which become useless in single thread mode. Although most static locks are indeed guarded by !defined(__SINGLE_THREAD__), some are not. This commit adds these missing guards to __dd_hash_mutex, __atexit_recursive_mutex, __at_quick_exit_mutex and __arc4random_mutex. It also makes sure locking macros in lock.h are noop in single thread mode.
2017-02-06Unify names of all lock objectsFreddie Chopin1-3/+3
In preparation for the patch that would allow retargeting of locking routines, rename all lock objects to follow this pattern: "__<name>_[recursive_]mutex". Following locks were renamed: __dd_hash_lock -> __dd_hash_mutex __sfp_lock -> __sfp_recursive_mutex __sinit_lock -> __sinit_recursive_mutex __atexit_lock -> __atexit_recursive_mutex _arc4random_mutex -> __arc4random_mutex __env_lock_object -> __env_recursive_mutex __malloc_lock_object -> __malloc_recursive_mutex __atexit_mutex -> __at_quick_exit_mutex __tz_lock_object -> __tz_mutex
2017-01-25Prefix consistenly target-independent locks with __Thomas Preudhomme1-3/+3
Hi, With the patch to allow newlib's locking routine to be retargeted currently under discussion, we need to start thinking of locks as part of newlib's ABI since newlib depends on specific names being provided by the OS. This patch renames 2 locks so that they follow the same naming convention as other locks. It needs to be applied before the retargeting patch, while locks are still an internal consideration. Newlib builds successfully with this change. Ok for master branch? Best regards, Thomas
2016-02-12Fix compile with GCC 5 -WerrorYaakov Selkowitz1-0/+1
newlib/libc/ * stdio64/freopen64.c: Include <string.h> for memset(). * stdlib/quick_exit.c: Include <unistd.h> for _exit(). * string/gnu_basename.c (__gnu_basename): Fix discarded const qualifier warning. * stdlib/strtold.c: Include "mprec.h" for _strtorx_r(). Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-10-19C11 quick_exit() support for <stdlib.h>Sebastian Huber1-0/+81
Import some <stdlib.h> function declarations from latest FreeBSD and implement them. I am not sure if we should call the global reent cleanup in quick_exit() similar to exit(). newlib/ChangeLog 2015-10-14 Sebastian Huber <sebastian.huber@embedded-brains.de> * libc/include/stdlib.h (at_quick_exit): Declare. (quick_exit): Likewise. * libc/stdlib/Makefile.am (GENERAL_SOURCES): Add quick_exit.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/quick_exit.c: New.