From 9ef1b91c0f59a1a15565c354b3e372ab265c7b5a Mon Sep 17 00:00:00 2001 From: jkim Date: Tue, 6 Jul 2010 17:18:05 +0000 Subject: Import ACPICA 20100702. --- osunixxf.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'osunixxf.c') diff --git a/osunixxf.c b/osunixxf.c index b457745..70f69c9 100644 --- a/osunixxf.c +++ b/osunixxf.c @@ -117,6 +117,8 @@ /* * These interfaces are required in order to compile the ASL compiler under * Linux or other Unix-like system. + * + * Note: Use #define __APPLE__ for OS X generation. */ #include @@ -126,6 +128,7 @@ #include #include #include +#include #include "acpi.h" #include "accommon.h" @@ -528,8 +531,15 @@ AcpiOsCreateSemaphore ( return (AE_BAD_PARAMETER); } - Sem = AcpiOsAllocate (sizeof (sem_t)); +#ifdef __APPLE__ + Sem = sem_open (tmpnam (NULL), O_EXCL|O_CREAT, 0755, InitialUnits); + if (!Sem) + { + return (AE_NO_MEMORY); + } +#else + Sem = AcpiOsAllocate (sizeof (sem_t)); if (!Sem) { return (AE_NO_MEMORY); @@ -540,6 +550,7 @@ AcpiOsCreateSemaphore ( AcpiOsFree (Sem); return (AE_BAD_PARAMETER); } +#endif *OutHandle = (ACPI_HANDLE) Sem; return (AE_OK); -- cgit v1.1