From 0686d5e26fd1949fbfd33a2441f750791bc87091 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Tue, 6 May 2014 16:24:27 +0100 Subject: [PATCH] Reserve some space in sem_t for the future. Reserve 12 more bytes in sem_t to give room for future implementation improvements. This gets us to a 16 bytes sem_t. Glibc uses 32 bytes (16 actual use + 16 reserved), while OpenBSD has 16 bytes (out of which 4 are for padding). Bug: 14587103 Bug: 12875898 Change-Id: Id835cc5abf874c651e6b5ad5b8f29c9d6ab08d5a --- libc/include/semaphore.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libc/include/semaphore.h b/libc/include/semaphore.h index 30e31239a..7ae3c3a75 100644 --- a/libc/include/semaphore.h +++ b/libc/include/semaphore.h @@ -33,10 +33,13 @@ __BEGIN_DECLS typedef struct { - volatile unsigned int count; + volatile unsigned int count; +#ifdef __LP64__ + int __reserved[3]; +#endif } sem_t; -#define SEM_FAILED NULL +#define SEM_FAILED NULL extern int sem_init(sem_t *sem, int pshared, unsigned int value); -- 2.11.0