summaryrefslogtreecommitdiff
path: root/src/lib/libc/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* remove _thread_malloc_init prototypeotto2008-06-141-2/+1
|
* remove _MALLOC_LOCK_INIT; major bump; ok deraadt@otto2008-06-131-5/+1
|
* - make arc4random*() functions thread safe. Use a custom spinlock functionkurt2008-01-011-1/+13
| | | | | | | | | | | 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@
* fix misleading comment; the _MUTEX_LOCK/_MUTEX_UNLOCK macros work withkurt2007-11-191-2/+2
| | | | both static and non-static mutexs.
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-051-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Part 2 of file descriptor race and deadlock corrections.kurt2006-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust design of file descriptor table to eliminate races with both opening and closing of file descriptor entries and eliminates one class of deadlocks. One nice side effect of this change in design should be better performance for applications that open and close many file descriptors due to reduced fd_table_lock contention and fd entry reuse. - Add entry states to manage use of entry and eliminate some closing races. fd entries are not deallocated upon close() now. - Call _thread_fd_table_init with one of five discreet modes to properly initialize an entry and manage the state transition to open. - When closing an entry hold the entry spinlock locked across the state transition and the _thread_sys_close call to close another race. - Introduce a new lock type FD_RDWR_CLOSE that transitions either a closed entry or an open entry into closing state and then waits for a RDWR lock so that the lock queue can unwind normally. All subsequent fd lock attempts for that entry are rejected with EBADF until the fd is fully closed, or reopened by dup2(). Once a thread holds the FD_RDWR_LOCK it is safe to close() it or dup2() on it. - When a thread creates a new fd there is a window of time when another thread could attempt to use the fd before the creating thread has initialized the entry for it. This can result in improper status_flags for the entry, so record the entries init mode, detect when this has happened and correct the status_flags when needed. reviewed by marc@ & brad@, tested by several, okay brad@
* Avouid a race in atexit() handling by introducing a lock. Problemotto2006-02-221-1/+12
| | | | | originally reported by Gergely Kovacs; help from dhartmei@; ok tedu@ millert@
* Use a forward declaration of struct timespec instead of assumingmillert2005-11-151-1/+2
| | | | | | it has already been defined by previous includes. While this is true at the moment, it will no longer be true after a pending includes cleanup. OK marc@
* activate LC_CTYPE for 8 bits locale.espie2005-08-081-0/+7
| | | | | | | Make sure tolower/toupper use the whole 8 bits. okay deraadt@ thanks to everyone who tested
* major bump to libc and libpthread to break the dependency of amarc2004-06-071-84/+76
| | | | | | particular implementation of libpthread for libc. libc no longer needs pthread.h to compile. OK millert@, brad@, tedu@
* thread safer libc (note: safer, not safe)marc2003-01-281-1/+10
| | | | | | | | | | Access to the global _res structure replaced by pointers to a per thread instance. If unthreaded the pointer is to the global structure. Also replaced a 64k stack array with malloc-ed memory so threaded aps (with a default 64k stack) have a chance at working. ok deraadt@
* thread safe libc -- 2nd try. OK miod@, millert@marc2002-11-051-40/+30
| | | | Thanks to miod@ for m68k and vax fixes
* back out previous patch.. there are still some vax/m68k issuesmarc2002-11-031-30/+40
|
* libc changes for thread safety. Tested on:marc2002-11-031-40/+30
| | | | | | | alpha (millert@), i386 (marc@), m68k (millert@ and miod@), powerpc (drahn@ and dhartmei@), sparc (millert@ and marc@), sparc64 (marc@), and vax (millert@ and miod@). Thanks to millert@, miod@, and mickey@ for fixes along the way.
* Part one of userland __P removal. Done with a simple regexp with some minor ↵millert2002-02-161-2/+2
| | | | hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
* put changes back, this time ALL the files.fgsch2001-09-041-3/+3
|
* Back out fgsch@'s tree breaking commits.todd2001-08-301-3/+3
| | | | Test next time, ok?
* fix some const warningsfgsch2001-08-301-3/+3
|
* #(endif|else) foo is incorrect, make it #endif /* foo */heko2001-08-121-2/+2
| | | | deraadt@ ok
* grammer/spellingtodd2001-01-041-2/+2
|
* typo in comment, AILASES -> ALIASESbrad2000-09-081-2/+2
|
* oopsd2000-01-061-2/+2
|
* rewrite to use the helpers in the thread/ directory and to define weak alias ↵d2000-01-061-135/+91
| | | | macros
* cleand1999-01-061-35/+39
|
* md spinlockd1998-12-211-74/+0
|
* add md _atomic_is_locked; cleand1998-12-181-2/+3
|
* Add thread-safety to libc, so that libc_r will build (on i386 at least).d1998-11-202-0/+248
| | | | | | | | | | | | | All POSIX libc api now there (to P1003.1c/D10) (more md stuff is needed for other libc/arch/*) (setlogin is no longer a special syscall) Add -pthread option to gcc (that makes it use -lc_r and -D_POSIX_THREADS). Doc some re-entrant routines Add libc_r to intro(3) dig() uses some libc srcs and an extra -I was needed there. Add more md stuff to libc_r. Update includes for the pthreads api Update libc_r TODO
* Fix RCS idstholo1996-08-191-1/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+18