summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strerror.3
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-04-19 14:02:03 +0000
committerbde <bde@FreeBSD.org>1996-04-19 14:02:03 +0000
commit0fa2dcd1efdcf97f881c4cacbbb9a72233932b2c (patch)
treeb92f29dc15f71cd76556b764db1f1babe507d479 /lib/libc/string/strerror.3
parent2ee0ebfbc48f3dfca6fe15fcf91e167a1ea0ac24 (diff)
downloadFreeBSD-src-0fa2dcd1efdcf97f881c4cacbbb9a72233932b2c.zip
FreeBSD-src-0fa2dcd1efdcf97f881c4cacbbb9a72233932b2c.tar.gz
Added `const' to types of sys_errlist and sys_nerr.
Use .Va instead of .Fa to describe these variables. Say a little about inconsistent declarations of sys_errlist in the BUGS section.
Diffstat (limited to 'lib/libc/string/strerror.3')
-rw-r--r--lib/libc/string/strerror.315
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3
index 784c061..ebf18fd 100644
--- a/lib/libc/string/strerror.3
+++ b/lib/libc/string/strerror.3
@@ -48,8 +48,8 @@
.Fd #include <stdio.h>
.Ft void
.Fn perror "const char *string"
-.Vt extern char *sys_errlist[];
-.Vt extern int sys_nerr;
+.Vt extern const char * const sys_errlist[];
+.Vt extern const int sys_nerr;
.Fd #include <string.h>
.Ft char *
.Fn strerror "int errnum"
@@ -100,11 +100,11 @@ followed by the error number in decimal.
.Pp
The message strings can be accessed directly using the external
array
-.Fa sys_errlist .
+.Va sys_errlist .
The external value
-.Fa sys_nerr
+.Va sys_nerr
contains a count of the messages in
-.Fa sys_errlist .
+.Va sys_errlist .
The use of these variables is deprecated;
.Fn strerror
should be used instead.
@@ -122,3 +122,8 @@ For unknown error numbers, the
.Fn strerror
function will return its result in a static buffer which
may be overwritten by subsequent calls.
+.Pp
+Programs that use the deprecated
+.Va sys_errlist
+variable often fail to compile because they declare it
+inconsistently.
OpenPOWER on IntegriCloud