summaryrefslogtreecommitdiffstats
path: root/lib/libpthread (follow)
Commit message (Collapse)AuthorAgeFilesLines
* After forking, the child is single threaded, so tell libc that. Thisguenther2009-10-211-1/+4
| | | | | | is needed to avoid deadlocks in popen() on FILE locking. ok kurt@
* - add a symbol to help gdb location pthread internals (_thread_ctx_offset)kurt2009-07-252-2/+3
| | | | ok kettenis@
* Use the md atomic code on mips64 instead of the horrid slow code. Should havemiod2009-06-011-5/+1
| | | | been noticed much time ago, but better late than never.
* A much better atomic lock routine.miod2009-06-011-43/+9
|
* Correct the _atomic_lock() asm so that gcc accepts the constraintsguenther2009-06-011-4/+4
| | | | | | when compiling without optimization; fix copied from the kernel's atomic.h ok miod@
* Increase default thread stack size to 256K on 32bit archs and 512K onkurt2009-04-211-2/+7
| | | | | 64bit archs to accommodate the growing number of ports that put large buffers on the stack. Supported by many with no objections.
* honor MSG_DONTWAITjakemsr2009-04-112-2/+4
| | | | ok marc@, guenther@
* these are public domain, verified with author; spotted by jjderaadt2009-02-151-1/+4
|
* Add pthread_attr_[sg]etguardsize() to match rthread, including manpagesguenther2008-12-1818-39/+269
| | | | | | Bump lib minor ok otto@ kurt@ marc@; doc review by jmc@
* Fix PR #5942: preserve errno across fd flag updates, so that successfulderaadt2008-10-021-1/+4
| | | | | | | calls to close(), closefrom(), and dup2() don't change it. ok tedu@, deraadt@, kurt@, millert@, art@, marco@ (miscommit: originally by guenther@)
* the license on this is PD; david leonard says soderaadt2008-10-025-5/+14
|
* Assert my copyright on files I gave to d@ back in 1998.drahn2008-10-011-1/+17
|
* Application-specified thread stacks didn't work with libpthreadguenther2008-07-071-11/+7
| | | | | | | 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@
* - correct .Dt for pthread_attr_setstack.3jmc2008-07-053-6/+8
| | | | - new sentence, new line
* Add manpage for pthread_attr_[sg]etstack(3)guenther2008-07-058-21/+133
| | | | | Correct misnaming in STANDARDS section ok brad@ otto@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | 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@
* Move _POSIX_THREAD_SAFE_FUNCTIONS into unistd.h and set it to 200112millert2008-06-251-2/+1
| | | | | now that we support all the _r functions required by POSIX 1003.1-2001. Also define _POSIX_REENTRANT_FUNCTIONS. OK kurt@ deraadt@
* Adjust the _SEM_CHECK_VALIDITY macro to detect NULL sem_t instead ofkurt2008-06-201-2/+4
| | | | | | segfaulting. okay marc@ todd@
* zap last thread_malloc_init reference. otto@ okfgsch2008-06-141-2/+1
|
* remove _MALLOC_LOCK_INIT; major bump; ok deraadt@otto2008-06-132-7/+2
|
* Don't grab the fd read lock for getsockopt(2), setsockopt(2),kurt2008-06-034-18/+66
| | | | | | | | 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@
* Return the proper values upon failure per POSIX for pthread_sigmask(3) andkurt2008-04-242-5/+12
| | | | | | | sigprocmask(2) in threaded programs. From Philip Guenther <guenther at sendmail.com> via PR library/5795. okay marc@
* - do not call pthread_atfork(3) handlers when a multithreaded programkurt2008-04-042-27/+49
| | | | | | 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@
* Use fileno() instead of peeking into FILE *; Paul Stoeberderaadt2008-03-231-4/+4
|
* bumpotto2008-03-161-1/+1
|
* Relocate internal pipe file descriptor if newfd collides with it. Fixeskurt2008-02-021-7/+32
| | | | | bsd_auth(2) issue when compiled with threads. Reported by Joachim Wieland <joachim.wieland at credativ.de>. okay otto@ marc@
* Properly align stack such that code that uses SSE2 instructions doesn't crash.kettenis2008-01-281-3/+7
| | | | ok espie@, beck@
* crank libc and libpthread, because libc cannot build lint libraries anymore if a syscall is OBSOL..deraadt2008-01-051-2/+2
|
* - make arc4random*() functions thread safe. Use a custom spinlock functionkurt2008-01-013-3/+18
| | | | | | | | | | | 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@
* make pthread vfork() not call fork(), but actually call vfork(). ourderaadt2007-11-203-6/+17
| | | | | | | 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
* apparently this function cannot return EBUSY, so back out -r1.7;jmc2007-07-261-6/+2
| | | | from pjanzen; ok marc
* Initialize the locks in key_table. On hppa _SPINLOCK_LOCKED is 0, so ankettenis2007-07-203-4/+17
| | | | | | | uninitialized lock ends up in a locked state. This lead to a deadlock if we called pthread_key_create(). ok marc@, kurt@
* Report the correct stack size and top for the primordial thread inkurt2007-07-081-15/+18
| | | | pthread_stackseg_np(). With input and okay marc@
* On hppa, function pointers may be be pointers to PLT entries. Handle thosekettenis2007-07-071-1/+12
| | | | | | | | 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@
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-059-12/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* typoskurt2007-06-051-3/+3
|
* convert to new .Dd format;jmc2007-05-3162-124/+124
|
* clean up lint warnings related to the nfds_t type. okay marc@ millert@kurt2007-05-216-25/+33
|
* Eliminate many lint warnings by either: using the appropriate type,kurt2007-05-1814-51/+70
| | | | | casting when safe or adding ARGSUSED where needed. Reviewed and improvements from millert@ and marc@. okay marc@
* lint warning corrections:kurt2007-05-018-15/+17
| | | | | | | - use the correct types - mark _thread_gc() w/ARGSUSED - fix a 'a cast does not yield an lvalue' okay marc@
* file descriptors are ints. make branch an int too for better structurekurt2007-05-011-3/+3
| | | | allignment. okay marc@
* more lint warning reductions. use int for all priority vars. okay marc@kurt2007-04-271-4/+4
|
* fix minor nit with previous commitkurt2007-04-271-2/+2
|
* fix thread_continuation_t typedef and use passed curthread instead ofkurt2007-04-275-17/+13
| | | | calling _get_curthread() again. fixes some lint warnings. okay marc@
* Remove unused function _thread_fd_unlock_owned() andkurt2007-04-272-47/+5
| | | | merge _thread_fd_unlock_thread() into _thread_fd_unlock(). okay marc@
* Use rlimit nofiles max to size fd/fdp tables instead of cur. Fixeskurt2007-04-2714-51/+63
| | | | applications that increase nofiles using setrlimit(2). ok marc@
* remove unused var. okay marc@kurt2007-04-261-7/+1
|
* Revert previous commit which introduced regressions in KDE.kurt2007-04-101-5/+2
|
* Upon fork() set the child's view of the stored file status flags inheritedkurt2007-04-071-2/+5
| | | | | | | | from the parent to all non-blocking. This prevents the child from restoring the file to be blocking upon close() and causing the parent to deadlock when it later attempts to utilize the blocking fd. Corrects the netbeans build failure caused by the jdk forkAndExec() function that replaces the std fd's before execvp(). okay marc@
* Remove duplicate definition of _POSIX_THREAD_ATTR_STACKSIZE and quietkurt2007-03-201-4/+1
| | | | build warnings noticed by david@. okay millert@ marc@