diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-03-10 21:34:19 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-03-10 21:34:19 -0500 |
commit | 81af503610761a69476a3adbe8341fa8b6d078aa (patch) | |
tree | 87d40059752e8c9db136c3b53f25bc4f1a3a103d /include | |
parent | 5fcebcde6aeba6ae4a339790beba5331fbcd3b6e (diff) | |
download | musl-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 'include')
-rw-r--r-- | include/limits.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/limits.h b/include/limits.h index e12819ba..55ad8231 100644 --- a/include/limits.h +++ b/include/limits.h @@ -30,6 +30,7 @@ #define PTHREAD_STACK_MIN PAGE_SIZE #define PTHREAD_DESTRUCTOR_ITERATIONS 4 #define SEM_VALUE_MAX 0x7fffffff +#define SEM_NSEMS_MAX 256 /* Arbitrary numbers... */ |