> Is it possible to test the accessability (rw or ro) of a memory region
> before writing to it?
>
> (I want to be able to test whether or not a string is in the code or
> data segment)

uggh.. do you not know? did you not put it there?

usually wanting to do something like this is due to bad design and a good
think about it will sort it out for you...

there is no easy way and I'm loathe to suggest a way.. you parse
/proc/self/maps and you figure out from that if the address of the string
is in a r-x or rw- area..

I persume you mean from userspace.. if you're in the kernel get back to
me, it'll be probably not as hard or maybe twice as hard..

again you probably only think you want to do this and you probably don't
need to ..

Dave.

 >
> Thanks,
>
> Andy
>
>

-- 
David Airlie, Software Engineer
http://www.skynet.ie/~airlied / [EMAIL PROTECTED]
pam_smb / Linux DecStation / Linux VAX / ILUG person

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to