summaryrefslogtreecommitdiff
path: root/libpthread/nptl/init.c
AgeCommit message (Collapse)Author
2024-02-22Introduce time64 support.Dmitry Chestnykh
This patch introduces *time64 syscalls support for uClibc-ng. Currently the redirection of syscalls to their *time64 analogs is fully supported for 32bit ARM (ARMv5, ARMv6, ARMv7). The main changes that take effect when time64 feature is enabled are: - sizeof(time_t) is 8. - There is a possibility os setting date beyond year 2038. - some syscalls are redirected: clock_adjtime -> clock_adjtime64 clock_getres -> clock_getres_time64 clock_gettime -> clock_gettime64 clock_nanosleep -> clock_nanosleep_time64 clock_settime -> clock_settime64 futex -> futex_time64 mq_timedreceive -> mq_timedreceive_time64 mq_timedsend -> mq_timedsend_time64 ppoll -> ppoll_time64 pselect6 -> pselect6_time64 recvmmsg -> recvmmsg_time64 rt_sigtimedwait -> rt_sigtimedwait_time64 sched_rr_get_interval -> sched_rr_get_interval_time64 semtimedop -> semtimedop_time64 timer_gettime -> timer_gettime64 timer_settime -> timer_settime64 timerfd_gettime -> timerfd_gettime64 timerfd_settime -> timerfd_settime64 utimensat -> utimensat_time64. - settimeofday uses clock_settime (like in glibc/musl). - gettimeofday uses clock_gettime (like in glibc/musl). - nanosleep uses clock_nanosleep (like in glibc/musl). - There are some fixes in data structures used by libc and kernel for correct data handling both with and without enabled time64 support. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2023-11-09libpthread/nptl: make default stack size configurableBen Wolsieffer
Threads currently have 2-4 MiB stacks by default (depending on the platform). This is fine on MMU platforms, where this stack space is not actually allocated until it is used, but tends to waste a large amount of memory on no-MMU platforms. This patch adds a PTHREADS_STACK_DEFAULT_SIZE Kconfig option that allows the user to override the default stack size at build time. This allows the user to select a reasonable default stack size for the software that runs on their system, and avoids the need to patch every package to add calls to pthread_attr_setstacksize(). An alternative to this patch would be to change the hardcoded default stack size on no-MMU platforms, but it is difficult to choose an appropriate value because the minimum required stack depends on the software in use. This would also be a breaking change. Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
2021-04-18libpthread/nptl: create timer thread with sufficiant stack size (account for ↵Peter Seiderer
TLS) Create timer thread with sufficiant stack size (take into account allocated space for thread-local-storage), for this backport glibc commit 'Create internal threads with sufficient stack size' ([1], [2]) introducing __pthread_get_minstack() and use it in __start_helper_thread(). Fixes timer_create() in case of linking with library using large TLS area (e.g openblas, see [3]). [1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2c1094bd700e63a8d7f547b3f5495bedb55c0a08 [2] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=630f4cc3aa019ede55976ea561f1a7af2f068639 [3] http://lists.busybox.net/pipermail/buildroot/2021-April/308281.html Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2018-12-14several patches for uclibc nghan_mao@c-sky.com
I've got several patches to fix ltp/openmp/uclibc-ng-test testcase fail on c-sky. - fix a ltp testcase. - fix the problem that pthread creat will fail when libomp is linked before libc, the variable pagesize is not init. - fix tst-cancel4 and tst-cancel16. tst-cancelx4 and tst-cancelx16 still fail with this patch applied, cleanup handler is not called for open/creat/fcntl, seems some thing wrong with unwind, I haven't check the rootcause yet.
2017-04-22remove unused HP_TIMING_AVAIL and headerWaldemar Brodkorb
cleanup unused and unsupported code.
2017-01-28remove PID cachingWaldemar Brodkorb
Follow GNU C Library from c579f48edba88380635ab98cb612030e3ed8691e and remove the PID caching. These simplifies the architecture specific assembly code. The run of the test suite found no regressions, it even solves some of the test failures for x86/x86_64/sparc. Reviewed-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Vineet Gupta <Vineet.Gupta1@synopsys.com> Acked-by: Matthew Fortune <Matthew.Fortune@imgtec.com> Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
2016-09-26use a single libc and deduplicate threading codeWaldemar Brodkorb
Similar to musl libc a single libc has many benefits and solves some open issues with uClibc-ng. - no pthread_mutex_* weak symbols exported anymore - applications no longer failing to link when either -lrt or -lpthread are missing for dynamic and static linking mode - smaller C library - slightly better runtime performance
2016-01-10NPTL: fix infinite recursionWaldemar Brodkorb
fix infinite recursion on application exit triggered by linking libc before libpthread. Patch from OpenWrt. Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-22use arch specific thread stack size for nptlWaldemar Brodkorb
Use the arch specific thread stack size for nptl if the size returned by getrlimits exceeds it - fixes threads on systems with only 16 MB RAM. Patch from OpenWRT Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-10-12fix static binaries linked with pthread and compiled with sspWaldemar Brodkorb
Move TLS initialization for static builds up to the calling function as suggested by Daniel Fahlgren. Reported-By: Daniel Fahlgren <daniel@fahlgren.se>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-15signal.h: provide prototype for __libc_sigaction and remove all othersPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-03-03add missing prototypesPeter S. Mazinger
Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2010-06-24use uniform form of C99 keywordsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-11silence some warnings about missing prototypesBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-04-22nptl: fix dynamic initialization of libpthreadTimo Teräs
If libpthread get's pulled in via dlopen(), we need to do libpthread initialization in dlopen(). Achieve this by making initializer function out of __pthread_initialize_minimal_internal. Add the proper linker flags and make it callable multiple times. Add also nodelete flag which ensures that libpthread will not get unmapped after it's been loading. Though, ld.so does not yet support this. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-14nptl: initialize stdio lockingTimo Teräs
uClibc requires the threading library to enable locking for stdio, or the locking is not done at all. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-14nptl: mark symbols with libc forwarder hiddenTimo Teräs
Add attribute_hidden to all symbols having libc forwarder. This prevents recursive self calls which would happen if libc is before libpthread in linking order: the forwarder functions would call itself via the function table, since the libpthread symbols would get overwritten with libc ones. This has not been a problem in glibc since there these symbols are marked hidden with linker version-script. Since we don't use one, we need to mark these explicitly. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-02-17Assorted fixed to get nptl compiling on ARMKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2010-02-16mass sync with glibc nptlAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-10-17libpthread/nptl: core of the "Native Posix Threading Library" for uClibcAustin Foxley
targetting arm,sh,i386,mips,sparc for now Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2005-05-20Back out nptl changes, which for now will be done in branches/uClibc-nptlEric Andersen
2005-05-11More glibc backward compatibility cruft. Oh the horror!"Steven J. Hill"
2005-05-07Import in NPTL code from glibc. For further information please"Steven J. Hill"
consult the 'README.NPTL' file.