On 12 February 2010 P3. 03:31:22 Jordi Beltran Creix wrote:
> Wouldn't that return EINVAL unless the address is aligned to the page
> boundary?

>From the man page:
"The OpenBSD implementation of mprotect() does not require addr to be
page-aligned". And code is agree, too.

But the problem is not with the address itself, it's all about how to
treat 0 passed as "len" parameter. I didn't checked behavior of other
*BSD, but their mprotect(2) pages do not say anything about treating 0
in "len" parameter at all. Linux manual is most clear: "The function
mprotect specifies the desired protection for the memory page(s)
containing part or all of the interval [addr,addr+len-1]".

--
  Best wishes,
    Vadim Zhukov

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Reply via email to