diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/errlst.c | 2 | ||||
-rw-r--r-- | lib/libc/string/strerror.3 | 5 | ||||
-rw-r--r-- | lib/libc/string/strerror.c | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/gen/errlst.c b/lib/libc/gen/errlst.c index b105cc8..d817823 100644 --- a/lib/libc/gen/errlst.c +++ b/lib/libc/gen/errlst.c @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> const char *const sys_errlist[] = { - "Undefined error: 0", /* 0 - ENOERROR */ + "No error: 0", /* 0 - ENOERROR */ "Operation not permitted", /* 1 - EPERM */ "No such file or directory", /* 2 - ENOENT */ "No such process", /* 3 - ESRCH */ diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3 index 2d6d206..0ec6cb0 100644 --- a/lib/libc/string/strerror.3 +++ b/lib/libc/string/strerror.3 @@ -32,7 +32,7 @@ .\" @(#)strerror.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd October 12, 2004 +.Dd April 5, 2011 .Dt STRERROR 3 .Os .Sh NAME @@ -114,6 +114,9 @@ the range 0 < .Fa errnum < .Fa sys_nerr . +The number 0 is also recognized, although applications that take advantage of +this are likely to use unspecified values of +.Va errno . .Pp If insufficient storage is provided in .Fa strerrbuf diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index 890ed21..57d253d 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -87,7 +87,7 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen) catd = catopen("libc", NL_CAT_LOCALE); #endif - if (errnum < 1 || errnum >= sys_nerr) { + if (errnum < 0 || errnum >= sys_nerr) { errstr(errnum, #if defined(NLS) catgets(catd, 1, 0xffff, UPREFIX), |