diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-13 15:14:40 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-16 01:58:33 +0100 |
commit | c8f9421298f5f973b31a7cbbc76e61b06eca03bc (patch) | |
tree | 86bf4c058624d76b6e35fd44f1f506c3ad9b3d94 /sysdeps/htl/sem-init.c | |
parent | 644d98ec4d8405e9b721ecb715483ea1983e116f (diff) | |
download | glibc-c8f9421298f5f973b31a7cbbc76e61b06eca03bc.zip glibc-c8f9421298f5f973b31a7cbbc76e61b06eca03bc.tar.gz glibc-c8f9421298f5f973b31a7cbbc76e61b06eca03bc.tar.bz2 |
htl: Add pshared semaphore support
The implementation is extremely similar to the nptl implementation, but
with slight differences in the futex interface. This fixes some of BZ
25521.
Diffstat (limited to 'sysdeps/htl/sem-init.c')
-rw-r--r-- | sysdeps/htl/sem-init.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sysdeps/htl/sem-init.c b/sysdeps/htl/sem-init.c index 2be6ab4..196846d 100644 --- a/sysdeps/htl/sem-init.c +++ b/sysdeps/htl/sem-init.c @@ -24,12 +24,6 @@ int __sem_init (sem_t *sem, int pshared, unsigned value) { - if (pshared != 0) - { - errno = EOPNOTSUPP; - return -1; - } - #ifdef SEM_VALUE_MAX if (value > SEM_VALUE_MAX) { @@ -38,7 +32,9 @@ __sem_init (sem_t *sem, int pshared, unsigned value) } #endif - *sem = (sem_t) __SEMAPHORE_INITIALIZER (pshared, value); + struct new_sem *isem = (struct new_sem *) sem; + + *isem = (struct new_sem) __SEMAPHORE_INITIALIZER (value, pshared); return 0; } |