<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libc/include, branch OPENBSD_4_2_BASE</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_4_2_BASE</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_4_2_BASE'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2007-06-05T18:11:48+00:00</updated>
<entry>
<title>_FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, so</title>
<updated>2007-06-05T18:11:48+00:00</updated>
<author>
<name>kurt</name>
<email></email>
</author>
<published>2007-06-05T18:11:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=a9f7df88bc0ab9f89af4f9e71a3e4daea3a14008'/>
<id>urn:sha1:a9f7df88bc0ab9f89af4f9e71a3e4daea3a14008</id>
<content type='text'>
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@
</content>
</entry>
<entry>
<title>Part 2 of file descriptor race and deadlock corrections.</title>
<updated>2006-09-26T14:18:28+00:00</updated>
<author>
<name>kurt</name>
<email></email>
</author>
<published>2006-09-26T14:18:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=3e7a96453995beff0dd6bfbefb9db0b02fbb7ef5'/>
<id>urn:sha1:3e7a96453995beff0dd6bfbefb9db0b02fbb7ef5</id>
<content type='text'>
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@ &amp; brad@, tested by several, okay brad@
</content>
</entry>
<entry>
<title>Avouid a race in atexit() handling by introducing a lock. Problem</title>
<updated>2006-02-22T07:16:32+00:00</updated>
<author>
<name>otto</name>
<email></email>
</author>
<published>2006-02-22T07:16:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=f79af607fea8db71524b8a4a1553fb437b284616'/>
<id>urn:sha1:f79af607fea8db71524b8a4a1553fb437b284616</id>
<content type='text'>
originally reported by Gergely Kovacs; help from dhartmei@;
ok tedu@ millert@
</content>
</entry>
<entry>
<title>Use a forward declaration of struct timespec instead of assuming</title>
<updated>2005-11-15T11:56:40+00:00</updated>
<author>
<name>millert</name>
<email></email>
</author>
<published>2005-11-15T11:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=5aae9fa1f07b086b852d9795330efd3d419d8804'/>
<id>urn:sha1:5aae9fa1f07b086b852d9795330efd3d419d8804</id>
<content type='text'>
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@
</content>
</entry>
<entry>
<title>activate LC_CTYPE for 8 bits locale.</title>
<updated>2005-08-08T05:53:01+00:00</updated>
<author>
<name>espie</name>
<email></email>
</author>
<published>2005-08-08T05:53:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=63dd09a8c91fcf1f022506ffd9fcf02dcb61818b'/>
<id>urn:sha1:63dd09a8c91fcf1f022506ffd9fcf02dcb61818b</id>
<content type='text'>
Make sure tolower/toupper use the whole 8 bits.

okay deraadt@
thanks to everyone who tested
</content>
</entry>
<entry>
<title>major bump to libc and libpthread to break the dependency of a</title>
<updated>2004-06-07T21:11:23+00:00</updated>
<author>
<name>marc</name>
<email></email>
</author>
<published>2004-06-07T21:11:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=ae9f75ae846c14c230b202c01a33e14601eb8c43'/>
<id>urn:sha1:ae9f75ae846c14c230b202c01a33e14601eb8c43</id>
<content type='text'>
particular implementation of libpthread for libc.  libc no longer
needs pthread.h to compile.
OK millert@, brad@, tedu@
</content>
</entry>
<entry>
<title>thread safer libc (note: safer, not safe)</title>
<updated>2003-01-28T04:58:00+00:00</updated>
<author>
<name>marc</name>
<email></email>
</author>
<published>2003-01-28T04:58:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=547ebab319b228b064cf5dcb3ff0ae1bf23d24a2'/>
<id>urn:sha1:547ebab319b228b064cf5dcb3ff0ae1bf23d24a2</id>
<content type='text'>
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@
</content>
</entry>
<entry>
<title>thread safe libc -- 2nd try.   OK miod@, millert@</title>
<updated>2002-11-05T22:19:55+00:00</updated>
<author>
<name>marc</name>
<email></email>
</author>
<published>2002-11-05T22:19:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=46d7850737001c91bbb8e55a40aa9db06e2285ff'/>
<id>urn:sha1:46d7850737001c91bbb8e55a40aa9db06e2285ff</id>
<content type='text'>
Thanks to miod@ for m68k and vax fixes
</content>
</entry>
<entry>
<title>back out previous patch.. there are still some vax/m68k issues</title>
<updated>2002-11-03T23:58:39+00:00</updated>
<author>
<name>marc</name>
<email></email>
</author>
<published>2002-11-03T23:58:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c8b772af00b03eb1dd9425663fd4b7f60c9693bb'/>
<id>urn:sha1:c8b772af00b03eb1dd9425663fd4b7f60c9693bb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libc changes for thread safety.  Tested on:</title>
<updated>2002-11-03T20:36:43+00:00</updated>
<author>
<name>marc</name>
<email></email>
</author>
<published>2002-11-03T20:36:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=c64ae263713a52181fce5e72d090dfc2a7b7b008'/>
<id>urn:sha1:c64ae263713a52181fce5e72d090dfc2a7b7b008</id>
<content type='text'>
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.
</content>
</entry>
</feed>
