other/9830: [pch] not working on Solaris 9

Michael Teske mteske@csksoftware.com
Wed Feb 26 10:22:00 GMT 2003

On Tuesday 25 February 2003 19:11, Geoff Keating wrote:
> > From: "Michael Teske" <mteske@csksoftware.com>
> > Organization: CSK Software AG
> > Date: Tue, 25 Feb 2003 16:30:21 +0100
> >
> > > MAP_FIXED would work if you can find a way to work out whether there's
> > > already something else mapped at that location.  I don't have a
> > > Solaris box right now, but I seem to remember that you could read
> > > memory map information out of /proc?
> >
> > Have to look at that, but that might be too os specific, or not?
> It would be host-specific, but that's OK; we have ways of dealing with
> such things.

Ok, here's a demo program attached. 
solaris_can_safely_be_mmapped() is the function one can use for Solaris 
versions newer that Solaris 2.6 (AKA Solaris 6,7,8,9). Older versions do not 
have this proc interface.

Hope that helps, 

P.S.: Of course I tested what happens if one overrides an already mapped 
region, it's really replacing it and segfaults, so you were right. 
Another thing to make it work without this would be to determine the offset 
before doing the mmap test and writing the mmi structure to the file. But 
from the code as it works now this is not easily archievable, I fear...

Michael Teske
<This space is left blank intentionally>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: procfsmap.c
Type: text/x-csrc
Size: 2380 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030226/6b628b88/attachment.bin>

More information about the Gcc-bugs mailing list