summaryrefslogtreecommitdiff
path: root/lib/libpthread
AgeCommit message (Collapse)Author
2011-04-09More NULL -> 0 fallout.Miod Vallat
2011-01-25Make the pthread scheduler block signals while restoring a newlyStefan Sperling
selected thread's state. Fixes random qemu crashes. ok miod@
2011-01-04Revert previous commit: if gcc picks a memory operand for the asm thenPhilip Guenthe
'movl' will result in an assembler error. Sorry llvm-clang users: fix your compiler to match gcc+as
2010-12-31Make this compile with llvm-clang; problem pointed out by Amit KulkarniPhilip Guenthe
2010-12-03Sync with amd64, to allow this to compile without warnings with gcc4:Miod Vallat
``Correct the _atomic_lock() asm so that gcc accepts the constraints when compiling without optimization; fix copied from the kernel's atomic.h'' spotted by jim@
2010-11-07there is no library function called sched_prio(), so this manual pageTheo de Raadt
was incorrectly named. there should be no sched_prio(3) page; it is misleading.
2010-11-07do not list MLINKed man pages multiple times in SEE ALSO;Jason McIntyre
2010-11-07tweak previous;Jason McIntyre
2010-11-07Add sched_get_priority_{min,max}. tested in a bulk by landry@.Federico G. Schwindt
input and ok from phessler@ and guenther@
2010-10-28Change basep parameter of getdirentries() to be off_t *, not long *Todd C. Miller
so it works correctly with large offsets (and matches other systems). This requires adding a new getdirentries syscall, with the old one renamed to ogetdirentries. All in-tree consumers of getdirentries() have been updated. Bump libc and libpthread major numbers. OK and with deraadt@
2010-07-13Fix PR 6417: if we're starting a thread and there's no other threadsPhilip Guenthe
running, then we need to start a gc thread...except when this is the very call to start a gc thread! "This works for me" marc@
2010-07-13Fix PR 6376: restore more thread library state if execve fails,Philip Guenthe
including the scheduling timer, sigmask, fd nonblocking status, and handling of the signals used by the thread library. ok marc@, additional testing by ajacoutot@
2010-07-12After forking, clear the 'thread joining this one' pointer in the child,Philip Guenthe
as the child only has the one thread remaining. ok marc@
2010-06-30Use __attribute__ ((aligned (16)), to make sure the FPU state is alignedMark Kettenis
on a 128-bit boundary like we do on amd64. The padding within the struct made sure the state was properly aligned *within* the struct, but since the alignment restriction on the struct itself was only 64-bit, the required alignment was not guaranteed. We just got lucky. ok oga@, guenther@
2010-06-27Instead of (manually) closing the _thread_kern_pipe before callingPhilip Guenthe
execve(), just set the close-on-exec flag. Fixes PRs 6183 and 6376. ok marc@, "seems clearly better" tedu@
2010-05-25Make sure that we really mark the FPU registers clean.Mark Kettenis
ok deraadt@
2010-05-03document when the _timed{rd,wr}lock functions first appeared; from bradJason McIntyre
ok guenther
2010-04-12Add support for pthread_rwlock_timed locks.Ted Unangst
from brad. ok kurt, who's too busy to commit
2010-02-03Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentMiod Vallat
files or directories when applicable. The inspiration and name of MACHINE_CPU come from NetBSD, although the way to provide it to Makefiles is completely different. ok kettenis@
2010-01-03Make SO_RCVTIMEO and SO_SNDTIMEO work with pthreads. Fixes at least some ofFederico G. Schwindt
the issues seen with www/varnish. With input and help from guenther@ and kurt@. guenther@ ok
2009-12-06Make internal file descriptor handling async-signal safe by eliminatingKurt Miller
the use of spinlocks and malloc. All needed memory is allocated upfront and _thread_kern_sig_defer/undefer() is now used to protect critical sections. okay guenther@
2009-11-09Fix the handle locking in stdio to use flockfile/funlockfileKurt Miller
internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
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@