Dave Airlie wrote:

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?


No.  I didnt put it there.  I am writing a library function as follows:
void  log_string(char *in_str)
{
    .....  open file, write string, close file
    .....  write '\0' to *in_str to clear the log msg if in data seg
}

I agree it's ugly, but it needs to be done for backward compatablity reasons.

Under QNX I had a function _ispermitw(void *addr) to test write access.

Yes, from user space.
From kernel space I actually know how to do!!

Regards,

Andy



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

Reply via email to