From: <cv...@ce...> - 2009-08-11 07:44:02
|
Update of /home/cvs/cebix/BasiliskII/src/Unix by asvitkine Modified Files: vm_alloc.cpp Log Message: [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. |