summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2009-10-28Remove mutext from list of held mutexes in _mutex_reinit(). CorrectsKurt Miller
a failure to lock the _atfork_mutex after forking. Tested by ajacoutot@ and myself. okay guenther@
2009-10-27- bump the majors of libpthread and librthread, as they used to return anJasper Lievisse Adriaanse
aliased ENOTSUP. i should've done this earlier, but missed it. my bad. as discussed with deraadt@ guenther@
2009-10-27define ENOTSUP EOPNOTSUPP is no longer neededTheo de Raadt
2009-10-22Back out previous commit, as it caused too much growth for the installPhilip Guenthe
media to fit
2009-10-21Change libpthread's f*lockfile() routines to stop acting as no-opsPhilip Guenthe
for FILEs that don't have real file-descriptors: the fake FILEs used internally by snprintf/asprintf/vfprintf and friends now avoid unnecessary locking by calling the internal __vfprintf() routine directly and we do want to do locking on FILEs created with funopen(). ok kurt@
2009-10-21After forking, the child is single threaded, so tell libc that. ThisPhilip Guenthe
is needed to avoid deadlocks in popen() on FILE locking. ok kurt@
2009-07-25- add a symbol to help gdb location pthread internals (_thread_ctx_offset)Kurt Miller
ok kettenis@
2009-06-01Use the md atomic code on mips64 instead of the horrid slow code. Should haveMiod Vallat
been noticed much time ago, but better late than never.
2009-06-01A much better atomic lock routine.Miod Vallat
2009-06-01Correct the _atomic_lock() asm so that gcc accepts the constraintsPhilip Guenthe
when compiling without optimization; fix copied from the kernel's atomic.h ok miod@
2009-04-21Increase default thread stack size to 256K on 32bit archs and 512K onKurt Miller
64bit archs to accommodate the growing number of ports that put large buffers on the stack. Supported by many with no objections.
2009-04-11honor MSG_DONTWAITJacob Meuser
ok marc@, guenther@
2009-02-15these are public domain, verified with author; spotted by jjTheo de Raadt
2008-12-18Add pthread_attr_[sg]etguardsize() to match rthread, including manpagesPhilip Guenthe
Bump lib minor ok otto@ kurt@ marc@; doc review by jmc@
2008-10-02Fix PR #5942: preserve errno across fd flag updates, so that successfulTheo de Raadt
calls to close(), closefrom(), and dup2() don't change it. ok tedu@, deraadt@, kurt@, millert@, art@, marco@ (miscommit: originally by guenther@)
2008-10-02the license on this is PD; david leonard says soTheo de Raadt
2008-10-01Assert my copyright on files I gave to d@ back in 1998.Dale Rahn
2008-07-07Application-specified thread stacks didn't work with libpthreadPhilip Guenthe
because it treated the supplied memory as holding an internal data structure instead of as the stack space itself ok kurt@, "looks ok" otto@, tested on hppa by kettenis@
2008-07-05- correct .Dt for pthread_attr_setstack.3Jason McIntyre
- new sentence, new line
2008-07-05Add manpage for pthread_attr_[sg]etstack(3)Philip Guenthe
Correct misnaming in STANDARDS section ok brad@ otto@
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-06-25Move _POSIX_THREAD_SAFE_FUNCTIONS into unistd.h and set it to 200112Todd C. Miller
now that we support all the _r functions required by POSIX 1003.1-2001. Also define _POSIX_REENTRANT_FUNCTIONS. OK kurt@ deraadt@
2008-06-20Adjust the _SEM_CHECK_VALIDITY macro to detect NULL sem_t instead ofKurt Miller
segfaulting. okay marc@ todd@
2008-06-14zap last thread_malloc_init reference. otto@ okFederico G. Schwindt
2008-06-13remove _MALLOC_LOCK_INIT; major bump; ok deraadt@Otto Moerbeek
2008-06-03Don't grab the fd read lock for getsockopt(2), setsockopt(2),Kurt Miller
getpeername(2) or getsockname(2). Its not needed and causes threads to block when another thread is blocked and holding the read lock. Instead just protect against fd state transitions. Blocking problem reported by David S H Rosenthal from lockss.org okay beck@ "looks sane" deraadt@
2008-04-24Return the proper values upon failure per POSIX for pthread_sigmask(3) andKurt Miller
sigprocmask(2) in threaded programs. From Philip Guenther <guenther at sendmail.com> via PR library/5795. okay marc@
2008-04-04- do not call pthread_atfork(3) handlers when a multithreaded programKurt Miller
calls vfork(2). "untested, but looks OK" marc@ - document vfork(2), popen(3) and system(3) don't call atfork handlers in multithreaded programs. okay jmc@
2008-03-23Use fileno() instead of peeking into FILE *; Paul StoeberTheo de Raadt
2008-03-16bumpOtto Moerbeek
2008-02-02Relocate internal pipe file descriptor if newfd collides with it. FixesKurt Miller
bsd_auth(2) issue when compiled with threads. Reported by Joachim Wieland <joachim.wieland at credativ.de>. okay otto@ marc@
2008-01-28Properly align stack such that code that uses SSE2 instructions doesn't crash.Mark Kettenis
ok espie@, beck@
2008-01-05crank libc and libpthread, because libc cannot build lint libraries anymore ↵Theo de Raadt
if a syscall is OBSOL..
2008-01-01- make arc4random*() functions thread safe. Use a custom spinlock functionKurt Miller
instead of the generic pthread macros since free(3) uses __arc4_getbyte() when freeing small sized allocations and the generic pthread macros call malloc(3). - eliminate passing pointers to a static variable with global scope (rs) for additional code clarity and reduction. - shlib minor bumps for libc and libpthread due to new functions. From andreas@ with some bits from me. okay tedu@ marc@ w/some spot checking from millert@
2007-11-20make pthread vfork() not call fork(), but actually call vfork(). ourTheo de Raadt
vfork() has only one semantic: "parent stalls until child does execve or exit" and no other semantic. it is unfair to act as if pthread vfork() suddenly lacks that semantic. ok kurt millert kettenis beck
2007-07-26apparently this function cannot return EBUSY, so back out -r1.7;Jason McIntyre
from pjanzen; ok marc
2007-07-20Initialize the locks in key_table. On hppa _SPINLOCK_LOCKED is 0, so anMark Kettenis
uninitialized lock ends up in a locked state. This lead to a deadlock if we called pthread_key_create(). ok marc@, kurt@
2007-07-08Report the correct stack size and top for the primordial thread inKurt Miller
pthread_stackseg_np(). With input and okay marc@
2007-07-07On hppa, function pointers may be be pointers to PLT entries. Handle thoseMark Kettenis
by replicating part of $$dyncall in the code that sets up a thread's initial stack frame. Also make sure we actually reserve some space for that initial stack frame. ok miod@
2007-06-05_FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, soKurt Miller
isolate its usage to libpthread only and replace with generic non-static mutex support in the one place it is needed: - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the functions weak so that libpthread can override with its own new versions that do the locking. - remove _thread_fd_lock/unlock() weak functions from libc and adjust libpthread for the change. - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc to support non-static mutexes in libc and add libpthread and librthread implementations for them. libc can utilize non-static mutexes via the new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can support both static and non-static mutexes but currently only using them for non-static. - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe for both thread libraries by using a non-static mutex in the struct _dirdesc (typedef DIR), utilizing it in the *dir functions and remove remaining and incorrect _FD_LOCK/UNLOCK() use in libc. - add comments to both thread libraries to indicate libc depends on the current implementation of static mutex initialization. suggested by marc@ - major bump libc and libpthread due to function removal, structure change and weak symbol conversions. okay marc@, tedu@
2007-06-05typosKurt Miller
2007-05-31convert to new .Dd format;Jason McIntyre
2007-05-21clean up lint warnings related to the nfds_t type. okay marc@ millert@Kurt Miller
2007-05-18Eliminate many lint warnings by either: using the appropriate type,Kurt Miller
casting when safe or adding ARGSUSED where needed. Reviewed and improvements from millert@ and marc@. okay marc@
2007-05-01lint warning corrections:Kurt Miller
- use the correct types - mark _thread_gc() w/ARGSUSED - fix a 'a cast does not yield an lvalue' okay marc@
2007-05-01file descriptors are ints. make branch an int too for better structureKurt Miller
allignment. okay marc@
2007-04-27more lint warning reductions. use int for all priority vars. okay marc@Kurt Miller
2007-04-27fix minor nit with previous commitKurt Miller
2007-04-27fix thread_continuation_t typedef and use passed curthread instead ofKurt Miller
calling _get_curthread() again. fixes some lint warnings. okay marc@
2007-04-27Remove unused function _thread_fd_unlock_owned() andKurt Miller
merge _thread_fd_unlock_thread() into _thread_fd_unlock(). okay marc@