From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 10 22:43:33 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF91F37B401 for ; Thu, 10 Jul 2003 22:43:33 -0700 (PDT) Received: from smtp.omnis.com (smtp.omnis.com [216.239.128.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85F2043F75 for ; Thu, 10 Jul 2003 22:43:33 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.homeunix.net (66-91-236-204.san.rr.com [66.91.236.204]) by smtp-relay.omnis.com (Postfix) with ESMTP id 1FEFD9BE2B; Thu, 10 Jul 2003 22:43:31 -0700 (PDT) From: Wes Peters Organization: Softweyr To: Matthew Emmerton , Terry Lambert Date: Thu, 10 Jul 2003 22:43:27 -0700 User-Agent: KMail/1.5.2 References: <20030710162030.R32209-100000@skippyii.compar.com> In-Reply-To: <20030710162030.R32209-100000@skippyii.compar.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307102243.27228.wes@softweyr.com> cc: freebsd-hackers@freebsd.org Subject: Re: RFC: Change to sys_errlist X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2003 05:43:34 -0000 On Thursday 10 July 2003 01:21 pm, Matthew Emmerton wrote: > On Sun, 6 Jul 2003, Terry Lambert wrote: > > Matthew Emmerton wrote: > > > This is a RFC on a change to sys_errlist for errno = 0. > > > > > > On Linux, if perror() or strerror() is called with errno = 0, the > > > resulting string is "Success". > > > On FreeBSD, the resulting string is "Unknown error: 0". > > > > > > I think that FreeBSD's output is unintentionally confusing, as > > > errno = 0 implies success. > > > > > > The following patch will change the output to the Linux behaviour. > > > > > > I appreciate any comments. > > > > Actually, I ran into a situation on MacOS X the other day that had > > a system call with a -1 return code with an errno == 0. > > > > I would personally like to distinguish this case, if only for the > > purpose of catching kernel errors. Saying "Success" when in fact > > the system call is returning -1 is a bogus thing to do. > > Agreed. I thought this over and read some specs and believe our way is > the right way. In point of fact, errno == 0 does NOT mean "Success", it means "WTF?". 0 isn't a valid errno, so no meaning can be gleaned from errno == 0 any more than it could be gleaned from errno == 0xb00bface or errno == 6.023e23. -- Where am I, and what am I doing in this handbasket? Wes Peters wes@softweyr.com