From owner-freebsd-doc Sat Dec 14 2:30: 9 2002 Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F111237B401 for ; Sat, 14 Dec 2002 02:30:06 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3811C43ED1 for ; Sat, 14 Dec 2002 02:30:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBEAU6x3031549 for ; Sat, 14 Dec 2002 02:30:06 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBEAU6oE031548; Sat, 14 Dec 2002 02:30:06 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65C1E37B401 for ; Sat, 14 Dec 2002 02:28:28 -0800 (PST) Received: from 213-84-207-11.adsl.xs4all.nl (nexus.xs4all.nl [213.84.207.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C10943EA9 for ; Sat, 14 Dec 2002 02:28:27 -0800 (PST) (envelope-from asmodai@nexus.ninth-circle.org) Received: by 213-84-207-11.adsl.xs4all.nl (Postfix, from userid 1000) id 5016D19D; Sat, 14 Dec 2002 11:29:43 +0100 (CET) Message-Id: <20021214102943.5016D19D@213-84-207-11.adsl.xs4all.nl> Date: Sat, 14 Dec 2002 11:29:43 +0100 (CET) From: Jeroen Ruigrok van der Werven Reply-To: Jeroen Ruigrok van der Werven To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/46252: [Patch] mprotect.2 update and clarification Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46252 >Category: docs >Synopsis: [Patch] mprotect.2 update and clarification >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 14 02:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Jeroen Ruigrok van der Werven >Release: FreeBSD 4.7-STABLE i386 >Organization: Ninth Circle Enterprises >Environment: System: FreeBSD nexus.chronias.ninth-circle.org 4.7-STABLE FreeBSD 4.7-STABLE #5: Sat Oct 19 12:35:12 CEST 2002 asmodai@nexus.chronias.ninth-circle.org:/usr/src/sys/compile/NEXUS i386 >Description: The mprotect(2) manual page is too short to be of much value for most programmers needing its information. They need to look through sources and header files, which isn't what you want experienced programmers doing commercial porting work to do. (Time is money!) >How-To-Repeat: Read the manual page and wonder: What's a region? What are the protection bits then? >Fix: Apply attached diff. Index: src/lib/libc/sys/mprotect.2 =================================================================== RCS file: /home/ncvs/FreeBSD/src/lib/libc/sys/mprotect.2,v retrieving revision 1.14 diff -u -r1.14 mprotect.2 --- src/lib/libc/sys/mprotect.2 24 Aug 2002 00:39:43 -0000 1.14 +++ src/lib/libc/sys/mprotect.2 14 Dec 2002 10:20:19 -0000 @@ -52,6 +52,22 @@ .Fa prot . Not all implementations will guarantee protection on a page basis; the granularity of protection changes may be as large as an entire region. +A region is the virtual address space defined by the start +and end addresses of a +.Vt "struct vm_map_entry" . +.Pp +Currently these protection bits are known, +which can be combined, OR'd together: +.Bl -tag width "PROT_WRITE" +.It PROT_NONE +No permissions at all. +.It PROT_READ +The pages can be read. +.It PROT_WRITE +The pages can be written. +.It PROT_EXEC +The pages can be executed. +.El .Sh RETURN VALUES .Rv -std mprotect .Sh ERRORS >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message