Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Mar 2007 13:10:34 +0300
From:      Anton Yuzhaninov <citrin@citrin.ru>
To:        freebsd-hackers@freebsd.org
Subject:   Why max mmap size limited to half of virtual address space?
Message-ID:  <782951585.20070312131034@citrin.ru>

next in thread | raw e-mail | index | archive | help
Hello,

Why  max mmap size limited to half virtual address space?
On i386 it limited to 2 Gb:

/sys/vm/vm_mmap.c

      /* make sure mapping fits into numeric range etc */
        if ((ssize_t) uap->len < 0 ||
            ((flags & MAP_ANON) && uap->fd != -1))
                return (EINVAL);


(ssize_t) uap->len < 0
limit maximum value for uap->len to SIZE_T_MAX/2

May be this check can be removed?

It test it on FreeBSD 6.2 i386 - without this check a can map 2400 Mb
file.

Also mmap man page say, that 2 Gb limit was a documentation bug, but this
limit still exist on i386.

-- 
 Anton Yuzhaninov.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?782951585.20070312131034>