From nobody@FreeBSD.org  Thu Jan 17 12:36:47 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 8AD2937B417
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 17 Jan 2002 12:36:47 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g0HKalX74823;
	Thu, 17 Jan 2002 12:36:47 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200201172036.g0HKalX74823@freefall.freebsd.org>
Date: Thu, 17 Jan 2002 12:36:47 -0800 (PST)
From: Steven Grady <grady@digitaldeck.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mmap man page description of ENOMEM is ambiguous
X-Send-Pr-Version: www-1.0

>Number:         34005
>Category:       docs
>Synopsis:       mmap man page description of ENOMEM is ambiguous
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 17 12:40:01 PST 2002
>Closed-Date:    Sun Feb 10 13:09:29 PST 2002
>Last-Modified:  Sun Feb 10 13:11:43 PST 2002
>Originator:     Steven Grady
>Release:        4.3
>Organization:
DigitalDeck, Inc.
>Environment:
FreeBSD inigo.digitaldeck.com 4.3-RELEASE-p20 FreeBSD 4.3-RELEASE-p20 #0: Wed Nov  7 21:15:47 PST 2001     mudie@inigo.digitaldeck.com:/usr/src/sys/compile/INIGO  i386
>Description:
The man page says under ENOMEM:
  MAP_FIXED was specified and the addr parameter wasn't available, or the system has reached the per-process mmap limit specified in the vm.max_proc_mmap sysctl.
  MAP_ANON was specified and insufficient memory was available.

This _could_ be taken to mean that the max_proc_mmap limit is only applicable when MAP_FIXED is specified.

It took me a while to track down an ElectricFence failure because I misinterpreted this line.
>How-To-Repeat:
      
>Fix:
Change to something like the following.
  MAP_FIXED was specified and the addr parameter wasn't available.
  The system has reached the per-process mmap limit specified in the vm.max_proc_mmap sysctl.
  MAP_ANON was specified and insufficient memory was available.
(I.e. separate the max_proc_mmap line from the MAX_FIXED line, to make it clear that they are independent.)
>Release-Note:
>Audit-Trail:

From: Hiten Pandya <hitmaster2k@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org, grady@digitaldeck..com
Cc:  
Subject: Re: docs/34005: mmap man page description of ENOMEM is ambiguous
Date: Fri, 18 Jan 2002 15:26:40 +0000

 hmm,
 
 It is true, that it would create confusion, because it was seperated by
 a comma.  I have made a patch which will resolve this, by whacking the
 vm.max_proc_mmap thing as the last reason from the three.
 
 As in:
 
 
 [ENOMEM]         MAP_FIXED was specified and the addr parameter wasn't
                  available.  MAP_ANON was specified and insufficient 
                  memory was available.  The system has reached the per-
                  process mmap limit specified in the vm.max_proc_mmap
                  sysctl.
 
 
 I have checked the patch.  This will avoid confusion.  Please don't 
 hesistate to contact me regarding this matter.
 
 thanks,
 regards,
 
  - Hiten
  - <hiten@uk.FreeBSD.org>
 
 The patch below :=
 ==========================================================================
 
 --- mmap.2.old  Fri Jan 18 15:05:39 2002
 +++ mmap.2      Fri Jan 18 15:13:44 2002
 @@ -302,12 +302,12 @@
  .Dv MAP_FIXED
  was specified and the
  .Fa addr
 -parameter wasn't available, or the system has reached the per-process
 mmap
 -limit specified in the
 -.Va vm.max_proc_mmap
 -sysctl.
 +parameter wasn't available. 
  .Dv MAP_ANON
  was specified and insufficient memory was available.
 +The system has reached the per-process mmap limit specified in the
 +.Va vm.max_proc_mmap
 +sysctl.
  .El
  .Sh SEE ALSO
  .Xr madvise 2 ,
 
 
 =======================
 SSH Fingerprint:
 1024 45:a5:9c:f2:fb:07:da:70:18:02:0b:f3:63:f1:7a:a6 hitenp@hpdi.ath.cx
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Sun Feb 10 13:09:29 PST 2002 
State-Changed-Why:  
Suggested patch applied, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34005 
>Unformatted:
