summaryrefslogtreecommitdiff
path: root/src/lib/libc/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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