On Thu, 2009-08-06 at 14:56 +0900, John Fremlin wrote:
Hi Stelian,
http://www.opengroup.org/onlinepubs/000095399/functions/mmap.html
Existing implementations of mmap() return the value -1 when unsuccessful. Since the casting of this value to type void * cannot be guaranteed by the ISO C standard to be distinct from a successful value, this volume of IEEE Std 1003.1-2001 defines the symbol MAP_FAILED, which a conforming implementation does not return as the result of a successful call.
I guess whoever wrote the mmap wrapper didn't read the manpage as it assumes 0 is the bad value. :-(
Here is a horrible hack for osicat. It should probably be changed to grovel for MAP_FAILED.
Done.
[The bytemap project has had a correct(?) way of handling this for nearly a year (http://common-lisp.net/project/bytemap/) if anybody is interested in a tested cross-Lisp mmap.]
If you move the project repo into public_html/git/ it will be picked up by gitweb at http://common-lisp.net/gitweb