fix sem_open and sem_close to obey posix semantics
authorRich Felker <dalias@aerifal.cx>
Fri, 11 Mar 2011 02:34:19 +0000 (21:34 -0500)
committerRich Felker <dalias@aerifal.cx>
Fri, 11 Mar 2011 02:34:19 +0000 (21:34 -0500)
commit81af503610761a69476a3adbe8341fa8b6d078aa
tree87d40059752e8c9db136c3b53f25bc4f1a3a103d
parent5fcebcde6aeba6ae4a339790beba5331fbcd3b6e
fix sem_open and sem_close to obey posix semantics

multiple opens of the same named semaphore must return the same
pointer, and only the last close can unmap it. thus the ugly global
state keeping track of mappings. the maximum number of distinct named
semaphores that can be opened is limited sufficiently small that the
linear searches take trivial time, especially compared to the syscall
overhead of these functions.
include/limits.h
src/conf/sysconf.c
src/thread/sem_close.c [deleted file]
src/thread/sem_open.c