tech-userlevel archive

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

Re: check memory mapping



In article <20140822095916.GD23535%homeworld.netbsd.org@localhost>,
Emmanuel Dreyfus  <manu%netbsd.org@localhost> wrote:
>Hi
>
>Is there a way for a process to check whether a given address in mmeory 
>is accessible, without triggering a signal?
>
>There is mincore(), but it jus says wether it is already in resident
>memory, not if accessing the address will swap it in or cause a SIGSEGV.

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.

christos



Home | Main Index | Thread Index | Old Index