read maps from /proc/pid/

hi,
i hav a query abt reading the contents of /proc/pid/maps file.is there any system apis or functions available to get the data from dat file and parse according to my need. i need name of the .so,Create date of the .so file.,Location of .so file etc.

please provide a good source.
yes i hav RHEL 4.

sanjay

This post is related in some way to another post by you regarding the file descriptors. I don't know about any APIs that you can use, but you could just read the file one line at a time.

Also, according to the man page of /proc, in all kernels above 2.0, the last field in each line will contain the name of the file that is mapped to the particular region (if the second to last field is non-zero). So you can easily get the files that are mapped by that process. However, regarding create time of the library, file inodes in unix do not hold any information regarding file creation times, so you won't be able to get that.

Again, note that you will need root if you want to read this file for all processes on the system.

yes, that i got. then i want only module(i mean .so file) path and module(.so file name) name from map.how can i get these two things thru a program?

thanks 4 the replay..
sanjya

Seeing that this is a flat file, you can just open(2), read(2) line-by-line, check if the line contains a '.so', and close(2). There's your program.