about summary refs log tree commit diff
path: root/src/thread/sem_close.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-10 21:34:19 -0500
committerRich Felker <dalias@aerifal.cx>2011-03-10 21:34:19 -0500
commit81af503610761a69476a3adbe8341fa8b6d078aa (patch)
tree87d40059752e8c9db136c3b53f25bc4f1a3a103d /src/thread/sem_close.c
parent5fcebcde6aeba6ae4a339790beba5331fbcd3b6e (diff)
downloadmusl-81af503610761a69476a3adbe8341fa8b6d078aa.tar.gz
musl-81af503610761a69476a3adbe8341fa8b6d078aa.tar.xz
musl-81af503610761a69476a3adbe8341fa8b6d078aa.zip
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.
Diffstat (limited to 'src/thread/sem_close.c')
-rw-r--r--src/thread/sem_close.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/thread/sem_close.c b/src/thread/sem_close.c
deleted file mode 100644
index 036ee540..00000000
--- a/src/thread/sem_close.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <semaphore.h>
-#include <sys/mman.h>
-
-int sem_close(sem_t *sem)
-{
-	return munmap(sem, sizeof *sem);
-}