tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: check memory mapping



On Aug 23,  1:45pm, manu%netbsd.org@localhost (Emmanuel Dreyfus) wrote:
-- Subject: Re: check memory mapping

| Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:
| 
| > > You could access it via system call like read(2) from /dev/zero to test
| > > if it is writable, or write(2) to /dev/null for readability.
| > 
| > I retain the read test. The write test is troublesome because it modify 
memory
| > if it is accessible.
| 
| The read test works very well, but what about a write test that does not
| really change memory?

You write the pointer to a file, if the write was successful, you can read
the contents of the pointer. You rewind the file, and read from it into
the pointer. If successful, you can write to the pointer and since you
read what you just wrote, the memory contents are the same.

christos


Home | Main Index | Thread Index | Old Index