From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 6 09:18:13 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 7C62537B401 for ; Sun, 6 Jul 2003 09:18:13 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id E752544005 for ; Sun, 6 Jul 2003 09:18:12 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfmrb.dialup.mindspring.com ([165.247.219.107] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19ZCDL-0000Jw-00; Sun, 06 Jul 2003 09:18:11 -0700 Message-ID: <3F084B85.5CF7F6B0@mindspring.com> Date: Sun, 06 Jul 2003 09:17:09 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Matthew Emmerton References: <001901c34256$95e4db10$1200a8c0@gsicomp.on.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a473f9b5eb7b0e8053be1cc9a79031bf33350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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: Sun, 06 Jul 2003 16:18:14 -0000 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. -- Terry