summaryrefslogtreecommitdiff
path: root/lib/libc/include
AgeCommit message (Collapse)Author
2006-09-26Part 2 of file descriptor race and deadlock corrections.Kurt Miller
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@
2006-02-22Avouid a race in atexit() handling by introducing a lock. ProblemOtto Moerbeek
originally reported by Gergely Kovacs; help from dhartmei@; ok tedu@ millert@
2005-11-15Use a forward declaration of struct timespec instead of assumingTodd C. Miller
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@
2005-08-08activate LC_CTYPE for 8 bits locale.Marc Espie
Make sure tolower/toupper use the whole 8 bits. okay deraadt@ thanks to everyone who tested
2004-06-07major bump to libc and libpthread to break the dependency of aMarco S Hyman
particular implementation of libpthread for libc. libc no longer needs pthread.h to compile. OK millert@, brad@, tedu@
2003-01-28thread safer libc (note: safer, not safe)Marco S Hyman
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@
2002-11-05thread safe libc -- 2nd try. OK miod@, millert@Marco S Hyman
Thanks to miod@ for m68k and vax fixes
2002-11-03back out previous patch.. there are still some vax/m68k issuesMarco S Hyman
2002-11-03libc changes for thread safety. Tested on:Marco S Hyman
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.
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-09-04put changes back, this time ALL the files.Federico G. Schwindt
2001-08-30Back out fgsch@'s tree breaking commits.Todd T. Fries
Test next time, ok?
2001-08-30fix some const warningsFederico G. Schwindt
2001-08-12#(endif|else) foo is incorrect, make it #endif /* foo */Heikki Korpela
deraadt@ ok
2001-01-04grammer/spellingTodd T. Fries
2000-09-08typo in comment, AILASES -> ALIASESBrad Smith
2000-01-06oopsDavid Leonard
2000-01-06rewrite to use the helpers in the thread/ directory and to define weak alias ↵David Leonard
macros
1999-01-06cleanDavid Leonard
1998-12-21md spinlockDavid Leonard
1998-12-18add md _atomic_is_locked; cleanDavid Leonard
1998-11-20Add thread-safety to libc, so that libc_r will build (on i386 at least).David Leonard
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
1996-08-19Fix RCS idsThorsten Lockert
Make sure everything uses {SYS,}LIBC_SCCS properly
1995-10-18initial import of NetBSD treeTheo de Raadt