asvitkine c6d88f213c [Michael Schmitt]
SheepShaver includes the C errno string in many error messages. One case is when it calls the memory allocation routines in the Basilisk II vm_alloc.cpp program.

This works when the memory allocation routine uses functions that set errno (such as mmap or malloc). For example, running SheepShaver on a Linux hosts produces meaningful error messages.

The problem is that when run on an OS X host, the memory allocation uses Mach routines such as vm_allocate, which do not set errno.

So when SheepShaver reported the error, it used a stale value of errno, which happened to be 17. The result was an extremely misleading error message: "Cannot map RAM: File already exists".

The fix is to change vm_alloc so that it translates Mac return codes into POSIX errno values.

It also initializes errno to 0 at the start of the memory allocation routine, so that no matter what path it takes, it won't return a stale value.
2009-08-11 07:43:46 +00:00
2009-08-11 07:43:46 +00:00
1999-10-03 14:16:16 +00:00
2009-08-06 18:12:25 +00:00
Description
Basilisk II and SheepShaver Macintosh emulators
22 MiB
Languages
C++ 66%
C 26.5%
M4 2.6%
Objective-C++ 1.7%
Assembly 1.2%
Other 1.9%