diff options
author | mike <mike@FreeBSD.org> | 2002-12-18 16:53:31 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-12-18 16:53:31 +0000 |
commit | 91ae3fa45da5b963b386ec2315195c8a46fca992 (patch) | |
tree | 16025c382d603596fbc3bf588b0fc5edf45a3c74 /lib/libc/string/strerror.3 | |
parent | e32cc6fbb43a3952c915a86eefab4195c58aaaf5 (diff) | |
download | FreeBSD-src-91ae3fa45da5b963b386ec2315195c8a46fca992.zip FreeBSD-src-91ae3fa45da5b963b386ec2315195c8a46fca992.tar.gz |
Rearrange strerror() so that its itoa procedure can be used with
strerror_r(). Doing this allows us to ensure that strerror_r() always
fills the supplied buffer regardless of EINVAL or ERANGE errors.
strerror()'s semantics have changed slightly such that an argument of
0 is now considered invalid and errno is set to EINVAL.
Remove internal regression test for strerror() and strerror_r(). This
will be reincarnated in src/tools/regression/lib/libc/string.
In strerror(3), add a comment about strerror()'s bogus return type.
PR: 44356
Diffstat (limited to 'lib/libc/string/strerror.3')
-rw-r--r-- | lib/libc/string/strerror.3 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3 index 93ed9b2..8a840e8 100644 --- a/lib/libc/string/strerror.3 +++ b/lib/libc/string/strerror.3 @@ -115,7 +115,7 @@ leaves unchanged and returns .Er EINVAL . Error numbers recognized by this implementation fall in -the range 0 \(<= +the range 0 \(< .Fa errnum < .Fa sys_nerr . @@ -169,6 +169,11 @@ For unknown error numbers, the function will return its result in a static buffer which may be overwritten by subsequent calls. .Pp +The return type for +.Fn strerror +is missing a type-qualifier; it should actually be +.Vt const char * . +.Pp The .Fn perror function is implemented in terms of |