Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jul 2003 14:03:34 -0400
From:      "Matthew Emmerton" <matt@gsicomp.on.ca>
To:        <freebsd-hackers@freebsd.org>
Subject:   RFC: Change to sys_errlist
Message-ID:  <001901c34256$95e4db10$1200a8c0@gsicomp.on.ca>

next in thread | raw e-mail | index | archive | help
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 <stdio.h>

 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001901c34256$95e4db10$1200a8c0>