On 5/24/10 10:44 AM, Lin Ming wrote: > >> From: Stefan Reinauer >> Date: Sat, May 15, 2010 at 12:53 AM >> Subject: [Devel] [PATCH] Fix iasl on Mac OS X >> To: devel(a)acpica.org >> >> >> 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. >> > Hi, > > I got below error, need to add "#include " to fix it. > > cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include -I../compiler -c -o ../osunixxf.o ../osunixxf.c > ../osunixxf.c: In function ‘AcpiOsCreateSemaphore’: > ../osunixxf.c:543: error: ‘O_EXCL’ undeclared (first use in this function) > ../osunixxf.c:543: error: (Each undeclared identifier is reported only once > ../osunixxf.c:543: error: for each function it appears in.) > ../osunixxf.c:543: error: ‘O_CREAT’ undeclared (first use in this function) > make: *** [../osunixxf.o] Error 1 > Thank you for testing this. I will update the patch. > And another warning is, > > ../osunixxf.o: In function `AcpiOsCreateSemaphore': > osunixxf.c:(.text+0x518): warning: the use of `tmpnam' is dangerous, better use `mkstemp' > > As gcc suggests, better to use "mkstemp". Not sure mkstemp is appropriate here. It creates a file while what we need is a semaphore. I will test, however, whether creating a semaphore by overwriting that file name works as one would hope. Stefan -- 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