svn commit: r348843 - head/sys/vm

Doug Moore unkadoug at gmail.com
Mon Jun 10 14:57:59 UTC 2019


The comment and the code that rejects size==0, or doesn't, are copied
below.  Konstantin Belousov is the last person to have touched most of
it, and can better explain its meaning than I.

Doug Moore

    /*
     * Enforce the constraints.
     * Mapping of length 0 is only allowed for old binaries.
     * Anonymous mapping shall specify -1 as filedescriptor and
     * zero position for new code. Be nice to ancient a.out
     * binaries and correct pos for anonymous mapping, since old
     * ld.so sometimes issues anonymous map requests with non-zero
     * pos.
     */
    if (!SV_CURPROC_FLAG(SV_AOUT)) {
        if ((size == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) ||
            ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0)))
            return (EINVAL);
    } else {
        if ((flags & MAP_ANON) != 0)
            pos = 0;
    }

On 6/10/19 9:27 AM, Shawn Webb wrote:
> Sounds good! I think the manpage still might still need a change
> to match the current behavior, or perhaps matching something similar
> to that vm_mmap.c comment. But that comment brings another question:
> what's the definition of "old binaries"? a.out?
>
> Thanks,
>



More information about the svn-src-all mailing list