From owner-freebsd-doc@FreeBSD.ORG Wed Dec 24 06:00:36 2003 Return-Path: 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 990AE16A4CF for ; Wed, 24 Dec 2003 06:00:36 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D41943D50 for ; Wed, 24 Dec 2003 06:00:32 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) hBOE0WFR040579 for ; Wed, 24 Dec 2003 06:00:32 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id hBOE0WrA040578; Wed, 24 Dec 2003 06:00:32 -0800 (PST) (envelope-from gnats) Resent-Date: Wed, 24 Dec 2003 06:00:32 -0800 (PST) Resent-Message-Id: <200312241400.hBOE0WrA040578@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Russell Francis Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F20316A4CE for ; Wed, 24 Dec 2003 05:54:21 -0800 (PST) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DADE43D41 for ; Wed, 24 Dec 2003 05:54:17 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.10/8.12.10) with ESMTP id hBODsGdL077776 for ; Wed, 24 Dec 2003 05:54:16 -0800 (PST) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.10/8.12.10/Submit) id hBODsGEJ077775; Wed, 24 Dec 2003 05:54:16 -0800 (PST) (envelope-from nobody) Message-Id: <200312241354.hBODsGEJ077775@www.freebsd.org> Date: Wed, 24 Dec 2003 05:54:16 -0800 (PST) From: Russell Francis To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.0 Subject: docs/60544: getenv(3) manpage doesn't state the return value from getenv() X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Dec 2003 14:00:36 -0000 >Number: 60544 >Category: docs >Synopsis: getenv(3) manpage doesn't state the return value from getenv() >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: Wed Dec 24 06:00:32 PST 2003 >Closed-Date: >Last-Modified: >Originator: Russell Francis >Release: FreeBSD 5.1-RELEASE >Organization: >Environment: FreeBSD zoidberg 5.1-RELEASE-p10 FreeBSD 5.1-RELEASE-p10 #0: Thu Oct 9 22:24:10 EDT 2003 root@localhost:/usr/obj/usr/src/sys/FREAKER i386 >Description: The getenv(3) manpage doesn't state that the return value should not be freed. This has the potential of creating confusion for developers who may be tempted to free the value returned from getenv. Attached is a short diff which clarifies description of the return value from getenv in the manpage. >How-To-Repeat: Type this #man 3 getenv >Fix: --- getenv.3 Mon Oct 13 10:15:27 2003 +++ getenv.3.new Mon Oct 13 10:15:03 2003 @@ -116,6 +116,13 @@ from the list. .Sh RETURN VALUES .Rv -std setenv putenv +.Pp +The +.Fn getenv +function returns NULL if the environment variable was not found. +If the variable was found, it returns the value of the variable +as a NULL terminated string. This string should not be modified +or freed. .Sh ERRORS .Bl -tag -width Er .It Bq Er ENOMEM >Release-Note: >Audit-Trail: >Unformatted: