History log of /freebsd-10.3-release/lib/libc/string/strerror.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 296373 04-Mar-2016 marius

- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
builds.
- Update newvers.sh to reflect RC1.
- Update __FreeBSD_version to reflect 10.3.
- Update default pkg(8) configuration to use the quarterly branch.

Approved by: re (implicit)

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 255108 31-Aug-2013 jilles

libc: Always use our own copy of sys_errlist and sys_nerr (.so only).

This ensures strerror() and friends continue to work correctly even if a
(non-PIE) executable linked against an older libc imports sys_errlist (which
causes sys_errlist to refer to the executable's copy with a size fixed when
that executable was linked).

The executable's use of sys_errlist remains broken because it uses the
current value of sys_nerr and may access past the bounds of the array.

Different from the message "Using sys_errlist from executables is not
ABI-stable" on freebsd-arch, this change does not affect the static library.
There seems no reason to prevent overriding the error messages in the static
library.


# 251069 28-May-2013 emaste

Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.


# 232973 14-Mar-2012 kib

Fix indentation.

MFC after: 3 days


# 220376 05-Apr-2011 jilles

Allow strerror(0) and strerror_r(0, ...).

Of course, strerror_r() may still fail with ERANGE.

Although the POSIX specification said this could fail with EINVAL and
doing this likely indicates invalid use of errno, most other
implementations permitted it, various POSIX testsuites require it to
work (matching the older sys_errlist array) and apparently some
applications depend on it.

PR: standards/151316
MFC after: 1 week


# 165903 09-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 142693 27-Feb-2005 phantom

Unbreak !NLS case


# 142667 27-Feb-2005 phantom

Add NLS catalogs support to strerror(), strerror_r() and strsignal().
Controlled by NLS define, currently disabled by default.

Idea obtained from: NetBSD


# 114443 01-May-2003 nectar

Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.


# 114256 29-Apr-2003 nectar

`Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
technique) so that we don't wind up calling into an application's
version if the application defines them.

Inspired by: qpopper's interfering and buggy version of strlcpy


# 108603 03-Jan-2003 mike

Optimize errstr() by reducing the number of times it walks a string.
As a side effect, it makes the code easier to read and requires less
pointer arithmetic.

Test by: strerror regression test
Submitted by: Tim Kientzle <kientzle@acm.org>


# 108118 20-Dec-2002 mike

Stylistic changes:
o Fix an English error (comma splice) and poorly worded sentence.
o Fix KNF ordering of variables (pointers come before arithmetic types).
o Restore hand-optimization of sizeof()-1, instead of strlen().
o Remove unneeded local variables in strerror_r().

Test by: strerror regression test
Requested by: bde
Reviewed by: bde


# 108044 18-Dec-2002 mike

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


# 99331 03-Jul-2002 mini

Fix off-by-one error.

PR: misc/40104
Submitted by: Neal Fachan <neal@isilon.com>
MFC after: 3 days


# 87480 07-Dec-2001 wes

Make strerror and strerror_r use sys_errlist[0] for errnum = 0. Be
more careful about reporting truncation with ERANGE in strerror_r.
Set errno to EINVAL for "unknown" errnum in strerror as required
by P1003.1-200x Draft June 14, 2001.

More carefully document the handling of strerrbuf when errors
(ERANGE, EINVAL) are encountered in strerror_r.

Reviewed by: bde (ongoing discussion)


# 87434 06-Dec-2001 wes

New, improved, more Posix-compliant strerror_r implementation,
complete with documentation.

Reviewed by: mike@ gad@
MFC after: 1 week


# 86944 27-Nov-2001 wes

Add strerror_r function per Posix prototype.

Reviewed by: Mike Barcroft <mike@FreeBSD.org>
MFC after: 2 weeks


# 86170 07-Nov-2001 obrien

rcsid[]->__FBSDID


# 77117 24-May-2001 obrien

Make the rcsid and FreeBSD IDs more sane in the wcs* and wmem* files.
Do the same for the non-wcs*/wmem* files while I'm here.


# 2505 05-Sep-1994 bde

Fix printing of weird errno's: negative values were printed as large
unsigned's; null termination was only guaranteed for the first call.

Fix lint: don't declare externs internally; they were both out of date.


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources