tech-userlevel archive

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

Re: check memory mapping

Christos Zoulas <> wrote:

> 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.

The location is set to PROT_WRITE using mprotect(), hence I cannot read
from it. 

Some context information: this is to pass a regression test suite for a
NetBSD implemenation of Linux's libaio. I do it in user space on top of
librt while Linux does it in kernel. Hence some test checks that a
system call (which is a function for me) returns EFAULT depending of
memory protection.

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index