From owner-freebsd-hackers Thu Jul 30 15:26:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA08546 for freebsd-hackers-outgoing; Thu, 30 Jul 1998 15:26:51 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from terra.Sarnoff.COM (terra.sarnoff.com [130.33.11.203]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id PAA08513 for ; Thu, 30 Jul 1998 15:26:45 -0700 (PDT) (envelope-from rminnich@Sarnoff.COM) Received: (from rminnich@localhost) by terra.Sarnoff.COM (8.6.12/8.6.12) id SAA20197; Thu, 30 Jul 1998 18:26:42 -0400 Date: Thu, 30 Jul 1998 18:26:41 -0400 (EDT) From: "Ron G. Minnich" X-Sender: rminnich@terra To: hackers@FreeBSD.ORG Subject: freebsd mmap: does the offset have to be blocksize-aligned Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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