From owner-freebsd-bugs Fri Nov 10 10:30: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B394137B4C5 for ; Fri, 10 Nov 2000 10:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA85290; Fri, 10 Nov 2000 10:30:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from thinking-cap.babyhippo.co.uk (m100-mp1-cvx1c.edi.ntl.com [62.253.12.100]) by hub.freebsd.org (Postfix) with ESMTP id A16E437B4C5 for ; Fri, 10 Nov 2000 10:20:02 -0800 (PST) Received: (from nick@localhost) by thinking-cap.babyhippo.co.uk (8.9.3/8.9.3) id SAA46830; Fri, 10 Nov 2000 18:19:50 GMT (envelope-from nick) Message-Id: <200011101819.SAA46830@thinking-cap.babyhippo.co.uk> Date: Fri, 10 Nov 2000 18:19:50 GMT From: nick@flirble.org Reply-To: nick@flirble.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/22754: mmap man page states non-page offsets do not work Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 22754 >Category: kern >Synopsis: mmap man page states that non-page aligned offsets don't work. they do. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Fri Nov 10 10:30:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Nicholas Clark >Release: FreeBSD 4.0-RELEASE i386 >Organization: >Environment: FreeBSD thinking-cap.babyhippo.co.uk 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Mon Mar 20 22:50:22 GMT 2000 root@monster.cdrom.com:/usr/src/sys/compile/GENERIC i386 Anything else needed here? >Description: the mmap man page states in the BUGS section: We currently can only deal with page aligned file offsets. This doesn't appear to be true as mmap() will map /etc/motd without error at offset 11. I assume that the documentation is out of date. >How-To-Repeat: #include #include #include #include #include #include #include int main () { int motd = open ("/etc/motd", O_RDONLY); void *mapped; if (motd < 0) { perror ("Failed to open /etc/motd"); return 1; } mapped = mmap(NULL, 1024, PROT_EXEC | PROT_READ | PROT_WRITE , MAP_PRIVATE, motd, 11); printf ("mapped = %p errno = %d\n", mapped, errno); return 0; } gives mapped = 0x280f000b errno = 0 on FreeBSD 3.4-STABLE, 4.0-RELEASE and 4.1-STABLE, all x86 (all I have access to) which isn't what the man page says should happen. >Fix: Ammend man page to remove this from the bugs. (It doesn't appear to be just regular files, as /dev/zero also works) Or if not all devices support it, state this in the BUGS section. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message