title: Detect mprotected memory address
body: <p>Is there a function to detect whether a given virtual address mapped by <code>mmap</code> is protected by <code>mprotect</code>? Accessing such an address will result in segmentation fault if <code>PROT_NONE</code> is set. So I'd like to first detect whether they're protected or not. </p>
  
  <p>It's better if I don't need to introduce signal handlers. If there isn't any such function, any other lightweight solution is also fine. Thanks.</p>