From owner-freebsd-arch@FreeBSD.ORG Thu May 3 16:04:03 2007 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BC2C16A406; Thu, 3 May 2007 16:04:03 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 90C3A13C487; Thu, 3 May 2007 16:04:02 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l43G3piO016023; Thu, 3 May 2007 20:03:51 +0400 (MSD) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l43G3p2N016021; Thu, 3 May 2007 20:03:51 +0400 (MSD) (envelope-from ache) Date: Thu, 3 May 2007 20:03:51 +0400 From: Andrey Chernov To: "Sean C. Farley" Message-ID: <20070503160351.GA15008@nagual.pp.ru> References: <20070501083009.GA4627@nagual.pp.ru> <20070501160645.GA9333@nagual.pp.ru> <20070501135439.B36275@thor.farley.org> <20070502.102822.-957833022.imp@bsdimp.com> <20070502183100.P1317@baba.farley.org> <20070502230413.Y30614@thor.farley.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070502230413.Y30614@thor.farley.org> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Daniel Eischen , arch@freebsd.org Subject: Re: HEADS DOWN X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2007 16:04:03 -0000 On Wed, May 02, 2007 at 11:08:18PM -0500, Sean C. Farley wrote: > On Wed, 2 May 2007, Daniel Eischen wrote: > > > On Wed, 2 May 2007, Sean C. Farley wrote: > > > > >> 2. getenv() sets errno to EINVAL and returns NULL if given a bad name > >> to find. setenv() and unsetenv() perform the same check on the > >> name; should not getenv() do the same? The check is easy to > >> remove. > > > > I don't think getenv() should set errno. The fact that it > > returns NULL is sufficient and POSIX doesn't define any errors > > for it. > > Fixed for errno. Also, no value is appropriate for errno when the name > does not exist. How about the feature that getenv() returns a NULL for > a bad name instead of allowing a core dump? Is that acceptable? Speaking about POSIXed error checking in *env() you can look at my backed out implemetation (via cvs diff), you may find it useful for you. -- http://ache.pp.ru/