From: <ni...@in...> - 2001-06-22 03:25:17
|
... > Having said that, I have just realized Darwin doesn't honor the > protection flags passed to mmap() (say PROT_READ only). So, an explicit > mprotect() has to be done just after that. I am going to wrap a number > of mmap()/mprotect() functions to reflect that and also the fact that > Darwin doesn't support mapping memory from device files (MAP_ANON works > though). 1) Wrappers? Good idea. 2) Sounds like you have had more success than I. I wasn't able to use _any_ mmap() calls under OS X. (it always gives an errno that says the function is unimplemented) 3) You may want to investigate the map_fd(), vm_allocate() and vm_deallocate() calls in this old Rhapsody (NextStep) document: http://developer.apple.com/techpubs/macosx/Legacy/Mach.pdf (Take a copy of it. It may disappear) ... > Note: vm_protect() exists in Mach/Darwin environments but with 4 > arguments. This is not a problem since we use C++. Could this be a > problem for Objective C if Nigel wants to have the same naming > conventions ? Won't be a problem, as my MacOS X port currently doesn't use main_unix.cpp anyway. (most of its stuff is in cpp_glue_MacOSX.cpp) -- | Nigel Pearson, ni...@in... | "Reality is that which, | | Telstra NW-D, Sydney, Australia. | when you stop believing | | Office: 9206 3468 Fax: 9212 6329 | in it, doesn't go away." | | Mobile: 0408 664435 Home: 9792 6998 | Philip K. Dick - 'Valis.' | |