summaryrefslogtreecommitdiff
path: root/lib/librthread
AgeCommit message (Collapse)Author
2016-06-01implicit function declaration is the error we really want, not theTed Unangst
annoying strict prototypes
2016-05-20Delete the _SDA_BASE and _SDA2_BASE symbols: they're unnecessary inPhilip Guenther
shared libraries...and I misspelled them anyway
2016-05-11remove hppa64 port, which we never got going beyond broken single users.Theo de Raadt
hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
2016-05-07Use a Thread Information Block in both single and multi-threaded programs.Philip Guenther
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
2016-04-15Document PROTO_NORMAL requires matching DEF_{,NON}STDPhilip Guenther
2016-04-15PROTO_NORMAL(pthread_cond_signal) requires DEF_STD(pthread_cond_signal)Philip Guenther
2016-04-15make pthread_barrier_wait behave more like it does on other platforms.Ted Unangst
from Kari Tristan Helgason
2016-04-09replace 0xf57ff05f with dmb syJonathan Gray
spotted by guenther
2016-04-02Wrap <pthread.h> and <pthread_np.h> to eliminate PLT entries for internalPhilip Guenther
references. Use _thread_pagesize for the semaphore mmap size instead of calling getpagesize() each time. ok beck@
2016-04-02Eliminate the need to explicitly invoke syscalls via their _thread_sys_*Philip Guenther
aliases by using a macro REDIRECT_SYSCALL() to map the symbols. Apply that to getthrid(), sysctl(), and issetugid() as well. ok mpi@ beck@
2016-03-21Rename the system call sendsyslog2 to sendsyslog. Keep the old oneAlexander Bluhm
as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
2016-03-20Prepare for future ld.so/libc bump: update <tib.h> with the definitionsPhilip Guenther
that will be needed and make libpthread work when ld.so/libc.a provide an initial TIB.
2016-03-10No point in keeping the threading support for vax, I guessPhilip Guenther
2016-01-27Replace the malloc spinlock with a mutex. This lock is held over system callsMark Kettenis
which run for many cycles and may even sleep. This leads to other threads spinning for a long time waiting on the lock. Using a mutex means those threads go to sleep and get woken up when the lock is released, which results in a lot less CPU usage. More work is needed to improve the performance of threaded code that suffers from malloc lock contention, but this diff makes ports like Firefox significantly more usable. Tested by many. ok mpi@, guenther@, tedu@, jca@
2015-12-10use geteuid to allow root to communicate with others.Ted Unangst
report from Jeunder Yu
2015-11-10Split the intra-thread functionality from kill(2) into its own syscallPhilip Guenther
thrkill(2), rolling the kill(2) syscall number with the ABI change to avoid breaking binaries during during the transition. thrkill(2) includes a 'tcb' argument that eliminates the need for locking in pthread_kill() and simplifies pthread_cancel(). Switch __stack_smash_handler() to use thrkill(2) and explicitly unblock SIGABRT. Minor bump to both libc and libpthread: make sure you install a new kernel! ok semarie@
2015-11-01delete old lint ARGSUSED commentsPhilip Guenther
2015-10-23Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadPhilip Guenther
into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
2015-10-18ld.so no longer needs or uses a bind lock, so stop setting it. ThisPhilip Guenther
eliminates a chunk of complexity from the libpthread init and the fork wrapper, as it was the bind lock that needed prebinding before use.
2015-10-15Handle F_ISATTY in the fcntl() stub as wellTheo de Raadt
ok guenther
2015-05-19Instead of testing for __ELF__ and/or vax, leave out the bits for interfacingPhilip Guenther
with ld.so locking whenever building NOPIC pointless use of __ELF__ noted by brad@ ok miod@
2015-05-12Put the right number of leading underscores in ___cerror and __cerror, forMiod Vallat
the sake of libpthread. Probably missed during the a.out->ELF switch, I can't believe this went unnoticed for so long.
2015-05-10In the child after fork, the dl lock has to be forced as its inner spinlockPhilip Guenther
may have been grabbed by another thread in the parent before the fork problem report from dcoppa@, ok kettenis@
2015-04-29Delete the duplicated sched_{policy,param} members from the internal structPhilip Guenther
pthread and instead use the values from the embedded struct pthread_attr. For bonus points, pay attention to the sched_inherit attribute and possibly set the values from the parent thread. Problem noted by natano of bitrig.
2015-04-07Make pthread_atfork() track the DSO that called it like atexit() does,Philip Guenther
unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
2015-01-24Add back <sys/param.h>; it's needed for MACHINE_STACK_GROWS_UP.Mark Kettenis
ok millert@, tobiasu@
2015-01-16Move to the <limits.h> universe.Theo de Raadt
review by millert, binary checking process with doug, concept with guenther
2014-12-08avoid void arithmetic. from david carlierTed Unangst
2014-11-16Don't restart syscalls on SIGTHR. When a cancellation happens, we need toPhilip Guenther
unroll to the cancellation check ok tedu@
2014-11-16Don't assume __thrsigdivert() autorestarts on EINTR. This lets us check forPhilip Guenther
cancellation properly when a handled (but not waited for) signal occurs ok tedu@
2014-08-31accept4() should be a cancellation point.Philip Guenther
Update the list in the pthread_testcancel(3) manpage: several were missing. noted by miod@
2014-08-31Declare and document getthrid()Philip Guenther
indirectly prodded by krw@
2014-08-09Only need <stdint.h> and not <inttypes.h> herePhilip Guenther
2014-07-16zap trailing newlines; "go for it" deraadtOkan Demirmen
2014-07-10__tfork_thread is in libc, so move the manpage over tooPhilip Guenther
ok deraadt@
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-07-01Use a flag on the pthread_t to indicate that the thread's stack wasPhilip Guenther
allocated by the kernel's execve bits. ok matthew@
2014-06-27Fix mmap() flag usage: explicitly specify MAP_PRIVATE and drop uselessMatthew Dempsky
MAP_FILE and MAP_HASSEMAPHORE flags. Discussed with deraadt, tedu, and kettenis
2014-06-23Remove unintended statement from my copyright blockPhilip Guenther
2014-05-02- Adjust pthread_stackseg_np to return the page aligned addressable stackKurt Miller
range. okay kettenis@, guenther@, deraadt@
2014-04-18It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
2014-03-18Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingMiod Vallat
this hardware alive is becoming increasingly difficult, and I should heed the message sent by the three disks which have died on me over the last few days. Noone sane will mourn these ports anyway. So long, and thanks for the fish.
2014-03-16lint is dead (long live the lint!), so stop using it as a cpp conditionalPhilip Guenther
(namespace pollution!) or talking about its opinion on code. ok krw@
2013-12-18Provide a random stackgrap on pthread frames. Use _STACKALIGNBYTES toTheo de Raadt
ensure the frames are aligned correctly. Discussed at length with guenther and kettenis ok kettenis, this is the right first step
2013-12-12Fix static linking of libpthread: have crt0 invoke __init_tcb() if it'sPhilip Guenther
defined and we don't think ld.so has already done the TCB setup. ok and much discussion miod@
2013-12-11revert to return EPERM for sem_init pshared until it really worksTed Unangst
reported by zhuk
2013-12-08Reduce the random name length when sem_init is called with psharedFederico G. Schwindt
following what is recommended for mkstemp. This reduces the number of calls to sched_yield considerably. tedu@ ok.
2013-11-29Don't try to reuse _initial_thread in the fork() wrapper, as thePhilip Guenther
thread's existing handle must continue to be valid and it didn't fully 'change' the thread handle anyway. For pthread_main_np(), use a new flag, THREAD_ORIGINAL, to indicate that the flagged thread is the original thread for *this* process. Fixes some ConsoleKit failures according to aja@
2013-11-26Remove unused var and include. Fix errno values as per spec.Federico G. Schwindt
NULL semaphore in sem_close(). Minor cosmetic changes. tedu@ zhuk@ ok
2013-11-22don't use PAGE_SIZE, it is not portable. Ted can polish this afterTheo de Raadt
if he wants, but let us get the tree building.