Hi Folks,

I know this is the kernel group and my question is somehow connected
with Java, but I just would like to get enlightened from the kernel
respective of what's going on here.

So I have a self-built from scratch 2.3.4 running on my Nexus S. I'm
trying to extract memory mapping information for each process. So in
shell I would use "cat /proc/<pid>/maps" to get the mappings in vm.
However, when I was trying to do the same in an Android application by
using Runtime.getRuntime().exec("cat /proc/<pid>/maps"), the process
returns nothing in either getErrorStream()(i.e. stderr) or
getInputStream()(i.e. stdout). One thing I noticed is that the
following situation works.Let's say my application's pid is 23456.

Runtime.getRuntime().exec("cat /proc/20000/status") works.
Runtime.getRuntime().exec("cat /proc/self/maps") works.

So these lead me into suspecting that whether my application has the
true root permission as I do in the shell. Even if I use an exec("su")
beforehand and the process's return shows that it succeeded getting
super user, I still get nothing from the "maps" file under other
processes.

So I guess the question is how can I make my kernel realize that my
application has the same permission as I do? Am I in the right
direction?

Thanks a lot!

Zhao.

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to