Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 1998 18:26:41 -0400 (EDT)
From:      "Ron G. Minnich" <rminnich@Sarnoff.COM>
To:        hackers@FreeBSD.ORG
Subject:   freebsd mmap: does the offset have to be blocksize-aligned
Message-ID:  <Pine.SUN.3.91.980730182025.20178A-100000@terra>

next in thread | raw e-mail | index | archive | help
here's a cute one from linux: (generic_file_mmap)
                if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
                        return -EINVAL; 

This is all 2.0.x kernels I have seen. It means that the offset for an
mmap has to be file-system-block-aligned. There are cases where the linux
ld.so double-maps libc.so, and in one case maps part of it on an 8k
boundary.  If you have a file system (such as mine) which can support
16384 or larger (65536? sure) blocksizes, elf programs can't run due to
this kernel restriction. Doesn't hurt, e.g., statically linked a.out, as
weird mmaps don't happen for them. Easy to work around, map your /lib with
4k blocks, problem solved, but funny. 

any block-aligned restrictions like this in freebsd mmap? I can't think of 
having seen it, but you here know better than me. I'm curious. 

thanks
ron

Ron Minnich                |"Using Windows NT, which is known to have some 
rminnich@sarnoff.com       | failure modes, on a warship is similar to hoping 
(609)-734-3120             | that luck will be in our favor"- A. Digiorgio
ftp://ftp.sarnoff.com/pub/mnfs/www/docs/cluster.html 

   



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.980730182025.20178A-100000>