From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 4 11:04:38 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 4DC1E37B401 for ; Fri, 4 Jul 2003 11:04:38 -0700 (PDT) Received: from tomts17-srv.bellnexxia.net (tomts17-srv.bellnexxia.net [209.226.175.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 493D643FB1 for ; Fri, 4 Jul 2003 11:04:37 -0700 (PDT) (envelope-from matt@gsicomp.on.ca) Received: from hermes ([65.95.177.176]) by tomts17-srv.bellnexxia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with SMTP id <20030704180435.FBVT1990.tomts17-srv.bellnexxia.net@hermes> for ; Fri, 4 Jul 2003 14:04:35 -0400 Message-ID: <001901c34256$95e4db10$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: Date: Fri, 4 Jul 2003 14:03:34 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: 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, 04 Jul 2003 18:04:38 -0000 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. --- /usr/src/lib/libc/gen/errlst.c Sat Apr 24 14:28:24 1999 +++ errlst.c Fri Jul 4 13:53:27 2003 @@ -38,7 +38,7 @@ #include const char *const sys_errlist[] = { - "Undefined error: 0", /* 0 - ENOERROR */ + "Success", /* 0 - ENOERROR */ "Operation not permitted", /* 1 - EPERM */ "No such file or directory", /* 2 - ENOENT */ "No such process", /* 3 - ESRCH */ -- Matt Emmerton