Subject: standards/33527: mlock/mlockall documentation and code difference
To: None <standards-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Simon Burge <simonb@netbsd.org>
List: netbsd-bugs
Date: 05/22/2006 06:15:00
>Number:         33527
>Category:       standards
>Synopsis:       mlock/mlockall documentation and code difference
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 22 06:15:00 +0000 2006
>Originator:     Simon Burge <simonb@netbsd.org>
>Release:        NetBSD 3.0_STABLE, -current as of 2006/05/22
>Organization:
>Environment:
>Description:
        mlock(2) and munlock(2) say that the first (address) parameter
        "should be aligned to a multiple of the page size" and lists in
        the ERRORS section that EINVAL is returned if this is not the
        case.

        The code in sys/uvm/uvm_mmap.c for sys_mlock() and sys_munlock()
        as a section beginning with the comment "align the address to a
        page boundary and adjust the size accordingly" and then aligns
        the args nicely for us and doesn't return an error if they were
        unaligned.

        SUSv3 makes no mention of alignment restrictions on the
        arguments and says that that it applies to whole pages covering
        the requested address space.

>How-To-Repeat:
        Code and manpage inspection.

>Fix:
        Not sure.  Just remove the section from the manpage describing
        the alignment restrictions?