All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Reinauer <stefan.reinauer at coresystems.de>
To: devel@acpica.org
Subject: [Devel] [PATCH] Fix iasl on Mac OS X
Date: Fri, 14 May 2010 18:53:16 +0200	[thread overview]
Message-ID: <4BED7FFC.6050202@coresystems.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

Hi,

Mac OS X does not support unnamed semaphores, which breaks iasl. The
attached patch tries a named semaphore in case sema_init claims that it
is not implemented.

Best regards,

Stefan Reinauer

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info(a)coresystems.de  • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866


[-- Attachment #2: acpica-unix-20100428-sema.diff --]
[-- Type: text/plain, Size: 848 bytes --]

Mac OS X does not implement unnamed semaphores.  So use a named one instead.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>

--- osunixxf.c	2010-05-14 17:18:57.000000000 +0200
+++ osunixxf.c	2010-05-14 18:15:57.000000000 +0200
@@ -126,6 +126,7 @@
 #include <sys/time.h>
 #include <semaphore.h>
 #include <pthread.h>
+#include <errno.h>
 
 #include "acpi.h"
 #include "accommon.h"
@@ -537,8 +538,14 @@
 
     if (sem_init (Sem, 0, InitialUnits) == -1)
     {
-        AcpiOsFree (Sem);
-        return (AE_BAD_PARAMETER);
+        if (errno == ENOSYS) {
+            AcpiOsFree (Sem);
+	     Sem = sem_open(tmpnam(NULL), O_EXCL|O_CREAT, 0755, InitialUnits);
+ 	 } else {
+            perror ("AcpiOsCreateSemaphore");
+            AcpiOsFree (Sem);
+            return (AE_BAD_PARAMETER);
+	 }
     }
 
     *OutHandle = (ACPI_HANDLE) Sem;

             reply	other threads:[~2010-05-14 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-14 16:53 Stefan Reinauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24  8:44 [Devel] [PATCH] Fix iasl on Mac OS X Lin Ming
2010-05-24  9:08 Stefan Reinauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BED7FFC.6050202@coresystems.de \
    --to=devel@acpica.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.