summaryrefslogtreecommitdiffstats
path: root/lib/librthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* implicit function declaration is the error we really want, not thetedu2016-06-011-2/+2
| | | | annoying strict prototypes
* Delete the _SDA_BASE and _SDA2_BASE symbols: they're unnecessary inguenther2016-05-201-2/+0
| | | | shared libraries...and I misspelled them anyway
* remove hppa64 port, which we never got going beyond broken single users.deraadt2016-05-111-41/+0
| | | | | | 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
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-0729-1692/+450
| | | | | | | | | | | | | | | | | 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@
* Document PROTO_NORMAL requires matching DEF_{,NON}STDguenther2016-04-151-1/+6
|
* PROTO_NORMAL(pthread_cond_signal) requires DEF_STD(pthread_cond_signal)guenther2016-04-151-1/+2
|
* make pthread_barrier_wait behave more like it does on other platforms.tedu2016-04-153-10/+22
| | | | from Kari Tristan Helgason
* replace 0xf57ff05f with dmb syjsg2016-04-091-2/+2
| | | | spotted by guenther
* Wrap <pthread.h> and <pthread_np.h> to eliminate PLT entries for internalguenther2016-04-0210-10/+226
| | | | | | | references. Use _thread_pagesize for the semaphore mmap size instead of calling getpagesize() each time. ok beck@
* Eliminate the need to explicitly invoke syscalls via their _thread_sys_*guenther2016-04-025-16/+32
| | | | | | | aliases by using a macro REDIRECT_SYSCALL() to map the symbols. Apply that to getthrid(), sysctl(), and issetugid() as well. ok mpi@ beck@
* Rename the system call sendsyslog2 to sendsyslog. Keep the old onebluhm2016-03-211-2/+2
| | | | | | as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
* Prepare for future ld.so/libc bump: update <tib.h> with the definitionsguenther2016-03-201-18/+8
| | | | | that will be needed and make libpthread work when ld.so/libc.a provide an initial TIB.
* No point in keeping the threading support for vax, I guessguenther2016-03-102-76/+0
|
* Replace the malloc spinlock with a mutex. This lock is held over system callskettenis2016-01-273-7/+28
| | | | | | | | | | | | | 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@
* use geteuid to allow root to communicate with others.tedu2015-12-101-2/+2
| | | | report from Jeunder Yu
* Split the intra-thread functionality from kill(2) into its own syscallguenther2015-11-103-39/+15
| | | | | | | | | | | | 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@
* delete old lint ARGSUSED commentsguenther2015-11-012-4/+2
|
* Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadguenther2015-10-233-42/+4
| | | | | | | | | 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@
* ld.so no longer needs or uses a bind lock, so stop setting it. Thisguenther2015-10-183-48/+5
| | | | | eliminates a chunk of complexity from the libpthread init and the fork wrapper, as it was the bind lock that needed prebinding before use.
* Handle F_ISATTY in the fcntl() stub as wellderaadt2015-10-151-1/+2
| | | | ok guenther
* Instead of testing for __ELF__ and/or vax, leave out the bits for interfacingguenther2015-05-194-22/+21
| | | | | | | with ld.so locking whenever building NOPIC pointless use of __ELF__ noted by brad@ ok miod@
* Put the right number of leading underscores in ___cerror and __cerror, formiod2015-05-121-2/+3
| | | | | the sake of libpthread. Probably missed during the a.out->ELF switch, I can't believe this went unnoticed for so long.
* In the child after fork, the dl lock has to be forced as its inner spinlockguenther2015-05-102-11/+18
| | | | | | may have been grabbed by another thread in the parent before the fork problem report from dcoppa@, ok kettenis@
* Delete the duplicated sched_{policy,param} members from the internal structguenther2015-04-293-13/+20
| | | | | | | | 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.
* Make pthread_atfork() track the DSO that called it like atexit() does,guenther2015-04-074-56/+27
| | | | | | | | | | 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@
* Add back <sys/param.h>; it's needed for MACHINE_STACK_GROWS_UP.kettenis2015-01-242-2/+4
| | | | ok millert@, tobiasu@
* Move to the <limits.h> universe.deraadt2015-01-163-6/+4
| | | | review by millert, binary checking process with doug, concept with guenther
* avoid void arithmetic. from david carliertedu2014-12-081-2/+3
|
* Don't restart syscalls on SIGTHR. When a cancellation happens, we need toguenther2014-11-161-2/+1
| | | | | | unroll to the cancellation check ok tedu@
* Don't assume __thrsigdivert() autorestarts on EINTR. This lets us check forguenther2014-11-161-4/+6
| | | | | | cancellation properly when a handled (but not waited for) signal occurs ok tedu@
* accept4() should be a cancellation point.guenther2014-08-312-2/+20
| | | | | | Update the list in the pthread_testcancel(3) manpage: several were missing. noted by miod@
* Declare and document getthrid()guenther2014-08-311-2/+1
| | | | indirectly prodded by krw@
* Only need <stdint.h> and not <inttypes.h> hereguenther2014-08-092-4/+4
|
* zap trailing newlines; "go for it" deraadtokan2014-07-161-2/+1
|
* __tfork_thread is in libc, so move the manpage over tooguenther2014-07-102-147/+1
| | | | ok deraadt@
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-2/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Use a flag on the pthread_t to indicate that the thread's stack wasguenther2014-07-013-9/+9
| | | | | | allocated by the kernel's execve bits. ok matthew@
* Fix mmap() flag usage: explicitly specify MAP_PRIVATE and drop uselessmatthew2014-06-272-4/+5
| | | | | | MAP_FILE and MAP_HASSEMAPHORE flags. Discussed with deraadt, tedu, and kettenis
* Remove unintended statement from my copyright blockguenther2014-06-231-2/+1
|
* - Adjust pthread_stackseg_np to return the page aligned addressable stackkurt2014-05-021-4/+11
| | | | range. okay kettenis@, guenther@, deraadt@
* It's been a quarter century: we can assume volatile is present with that name.guenther2014-04-182-4/+4
|
* Retire hp300, mvme68k and mvme88k ports. These ports have no users, keepingmiod2014-03-182-90/+0
| | | | | | | 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.
* lint is dead (long live the lint!), so stop using it as a cpp conditionalguenther2014-03-161-5/+1
| | | | | | (namespace pollution!) or talking about its opinion on code. ok krw@
* Provide a random stackgrap on pthread frames. Use _STACKALIGNBYTES toderaadt2013-12-181-5/+15
| | | | | | ensure the frames are aligned correctly. Discussed at length with guenther and kettenis ok kettenis, this is the right first step
* Fix static linking of libpthread: have crt0 invoke __init_tcb() if it'sguenther2013-12-121-6/+29
| | | | | | defined and we don't think ld.so has already done the TCB setup. ok and much discussion miod@
* revert to return EPERM for sem_init pshared until it really workstedu2013-12-111-4/+10
| | | | reported by zhuk
* Reduce the random name length when sem_init is called with psharedfgsch2013-12-081-2/+2
| | | | | | following what is recommended for mkstemp. This reduces the number of calls to sched_yield considerably. tedu@ ok.
* Don't try to reuse _initial_thread in the fork() wrapper, as theguenther2013-11-294-14/+17
| | | | | | | | | 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@
* Remove unused var and include. Fix errno values as per spec.fgsch2013-11-261-44/+37
| | | | | NULL semaphore in sem_close(). Minor cosmetic changes. tedu@ zhuk@ ok
* don't use PAGE_SIZE, it is not portable. Ted can polish this afterderaadt2013-11-221-2/+2
| | | | if he wants, but let us get the tree building.