[PATCH 2/5] posix: Change sem_t to the 32-bit object type

Joel Sherrill joel.sherrill at oarcorp.com
Mon Mar 9 12:33:10 UTC 2015


Object ides are not always 32 bits

On March 9, 2015 7:18:33 AM CDT, Sebastian Huber <sebastian.huber at embedded-brains.de> wrote:
>---
> cpukit/posix/include/semaphore.h | 2 +-
> cpukit/posix/src/semopen.c       | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/cpukit/posix/include/semaphore.h
>b/cpukit/posix/include/semaphore.h
>index b22453d..58b77e7 100644
>--- a/cpukit/posix/include/semaphore.h
>+++ b/cpukit/posix/include/semaphore.h
>@@ -40,7 +40,7 @@ extern "C" {
> /*
>  *  11.1 Semaphore Characteristics, P1003.1b-1993, p.219
>  */
>-typedef int sem_t;
>+typedef uint32_t sem_t;
> 
> /*
>  *  Bad semaphore Id
>diff --git a/cpukit/posix/src/semopen.c b/cpukit/posix/src/semopen.c
>index 0b98ca6..8841a6f 100644
>--- a/cpukit/posix/src/semopen.c
>+++ b/cpukit/posix/src/semopen.c
>@@ -139,6 +139,6 @@ return_id:
>     the_semaphore->Semaphore_id = the_semaphore->Object.id;
>     return &the_semaphore->Semaphore_id;
>   #else
>-    return (sem_t *)&the_semaphore->Object.id;
>+    return &the_semaphore->Object.id;
>   #endif
> }

--joel



More information about the devel mailing list