Ticket #24884: acpica-unix-20100428-sema.diff

File acpica-unix-20100428-sema.diff, 792 bytes (added by stepan@…, 15 years ago)

and the patch required to get a functional iasl

  • osunixxf.c

    Mac OS X does not implement unnamed semaphores.  So use a named one instead.
    
     
    126126#include <sys/time.h>
    127127#include <semaphore.h>
    128128#include <pthread.h>
     129#include <errno.h>
    129130
    130131#include "acpi.h"
    131132#include "accommon.h"
     
    537538
    538539    if (sem_init (Sem, 0, InitialUnits) == -1)
    539540    {
    540         AcpiOsFree (Sem);
    541         return (AE_BAD_PARAMETER);
     541        if (errno == ENOSYS) {
     542            AcpiOsFree (Sem);
     543             Sem = sem_open(tmpnam(NULL), O_EXCL|O_CREAT, 0755, InitialUnits);
     544         } else {
     545            perror ("AcpiOsCreateSemaphore");
     546            AcpiOsFree (Sem);
     547            return (AE_BAD_PARAMETER);
     548         }
    542549    }
    543550
    544551    *OutHandle = (ACPI_HANDLE) Sem;