Vamsi Krishna writes:
> What would be Solaris equivalent to Linux /proc/self/maps ?
> I found that on Solaris '/proc/self/xmap' is a binary file rather
> than a text file.

Right.  The exact format is described in proc(4).

> If I need a portable way of accessing the virtual address mappings
> for a process then getting that info by reading /proc/self/*map* seems
> not a portable way of doing it. Is there any standard way of doing this ?

What do you mean by "portable?"

If you mean "portable across different versions of Solaris," then use
the /proc/self/{map,xmap} files with the structures defined in
proc(4).

If you mean "portable between Solaris, Linux, and perhaps other
systems," then you'll need to create that portability at a higher
level within your application.  One way to do it is to design a
generic query API, and then have separate source files that implement
this API for each supported OS, and use your "./configure" (or
equivalent script) to select the right one at compile time.

In other words, there is no general, cross-platform way to do what
you're asking.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to