Re: mlock() return value issue in kernel 2.6.23.17

From: KOSAKI Motohiro
Date: Tue Oct 07 2008 - 20:59:29 EST


Hi Yanping,

> Hi Kosaki,
>
> Seems SUSv3 has more requirements beyond errno return code. Upon
> failure (EAGAIN, etc), it requires .no change is made to any locks in
> the address space of the process., but Linux mlock(2) will set vma flag
> as VM_LOCKED even if make_pages_present() fails for some pages in the
> vma. Any comment on this ?
>
> SUSv3: http://www.unix.org/single_unix_specification/
>
> "Upon successful completion, the mlock() and munlock() functions shall
> return a value of zero. Otherwise, no change is made to any locks in the
> address space of the process, and the function shall return a value of
> -1 and set errno to indicate the error."

Correct.

However, I haven't seen this behavior cause any trouble.
Do you know any case?

So, if nobody feel awful, I don't interest it so much ;)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/