diff options
Diffstat (limited to 'nptl/sem_open.c')
-rw-r--r-- | nptl/sem_open.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nptl/sem_open.c b/nptl/sem_open.c index b5a5de4eeb..bfd2dea94e 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -193,9 +193,14 @@ sem_open (const char *name, int oflag, ...) struct new_sem newsem; } sem; - sem.newsem.value = value; - sem.newsem.private = 0; +#if __HAVE_64B_ATOMICS + sem.newsem.data = value; +#else + sem.newsem.value = value << SEM_VALUE_SHIFT; sem.newsem.nwaiters = 0; +#endif + /* This always is a shared semaphore. */ + sem.newsem.private = LLL_SHARED; /* Initialize the remaining bytes as well. */ memset ((char *) &sem.initsem + sizeof (struct new_sem), '\0', |